Clear Filters
Clear Filters

How can i draw a line using only starting point ?

6 views (last 30 days)
I want to draw a line on an image. But i only know the [x1 y1] or starting co-ordinates. I already attached an image. Here, a red line which co-ordinates i know. so i calculate the midpoint [marked as blue]. I want to draw a line from this point to last top of the image [marked as yellow star] , considering the same angle as the red line have. so that, my another end point of line will need to calculate & line must need to pass in middle of stair region. But i dont understand how can i calculate the other endpoint using only one endpoint. It will be really appreciated if give elaborate explanation.
angle = -(max_ang-90)*pi/180; % max_ang i calculate using region_props
x_target =xx+cos(angle);% xx & yy center of red line.
y_target =yy+sin(angle);

Answers (0)

Categories

Find more on Modify Image Colors in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!