Finding coordinates of point(s) that are specific distance(s) away on a slanted straight line
Show older comments
Hello, I am a physician trying to locate points of interest on medical images. My problem boils down to the following:
I have an image with 7 points of interest that I need to identify on my image. The 7 points lie in a slanted straight line like so:

I could take advantage of image properties to find the coordinates of point A and C. d1, d2, and d3 are all known values. What script should I run to find the coordinates of the 2 crosses d1 distance from A? And similarly, how do I find the coordinates for B, and the 2 coordinates d3 distance from that?
Thank you so much for your help!
1 Comment
Star Strider
on 20 Aug 2016
Do you have any recommendations for radiology text or reference books relevant to both clinical and technical perspectives? (I’d appreciate Author-Title-ISBN so I know I’m getting the correct ones.) I’ve been looking for a while, but haven’t found any that seem to cover what I want. You’re the perfect person to ask!
Accepted Answer
More Answers (1)
Image Analyst
on 20 Aug 2016
Knowing points A and C, the equation of the line is
slope = (yc-ya) / (xc - xa);
y = slope * (x - xa) + ya;
To get the x for the left and right d1 point from A
angle = atan(slope);
xd1Left = xa - d1 * cos(angle);
xd1Right = xa + d1 * cos(angle);
To get point B from known point C
xb = xc + d2 * cos(angle);
To get the d3 points
xd3Left = xc + (d2-d3) * cos(angle);
xd3Right = xc + (d2+d3) * cos(angle);
To get the y values for any of those x values, plug them in for x in the formula for the line:
y = slope * (x - xa) + ya;
Categories
Find more on Lighting, Transparency, and Shading 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!
