How can i draw a line using only starting point ?

1 Ansicht (letzte 30 Tage)
sufian ahmed
sufian ahmed am 30 Aug. 2017
Bearbeitet: sufian ahmed am 30 Aug. 2017
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);

Antworten (0)

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by