Solved

Posted on 2011-03-23

Background:

I have a viewer application that displays images. One feature that I have added is the ability to draw annotations onto the image. One of the annotations that I would like to draw is a pointer (arrow) annotation so users can add focus to certain parts of the document.

What I have so far:

Breaking this down my annotation is really nothing more than a line drawn from the Starting Point (S) to the Ending Point (E) with two additional lines being drawn from S to two new points (P1, P2) where the lines S->P1 and S->P2 come off of point S at 45 degrees.

Additionally, I want my arrow head to grow and shrink with the size of the annotation, so what I have done is find the midpoint (M) of Line S->E, and then find the midpoint of line S->M to find the "Quarter point" (Q) which should be exactly one fourth of the given line S->E. If I draw a perpindicular line through point Q (the thin blue line) I know that point P1 and P2 should lie on that line. I also know that lines S->Q, Q->P1, and Q->P2 should all have the same length.

Question:

How do I find the points P1 and P2? I have attached a diagram to further explain my problem. The dashed red lines are the lines I hope to draw.

I have a viewer application that displays images. One feature that I have added is the ability to draw annotations onto the image. One of the annotations that I would like to draw is a pointer (arrow) annotation so users can add focus to certain parts of the document.

What I have so far:

Breaking this down my annotation is really nothing more than a line drawn from the Starting Point (S) to the Ending Point (E) with two additional lines being drawn from S to two new points (P1, P2) where the lines S->P1 and S->P2 come off of point S at 45 degrees.

Additionally, I want my arrow head to grow and shrink with the size of the annotation, so what I have done is find the midpoint (M) of Line S->E, and then find the midpoint of line S->M to find the "Quarter point" (Q) which should be exactly one fourth of the given line S->E. If I draw a perpindicular line through point Q (the thin blue line) I know that point P1 and P2 should lie on that line. I also know that lines S->Q, Q->P1, and Q->P2 should all have the same length.

Question:

How do I find the points P1 and P2? I have attached a diagram to further explain my problem. The dashed red lines are the lines I hope to draw.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Title | # Comments | Views | Activity |
---|---|---|---|

Group Data Frequency Distribution | 9 | 43 | |

Geomentry-Fundamental concepts | 6 | 59 | |

Energy conservation - Edward Leedskalnin | 20 | 93 | |

Coordinate Geometry-Finding ratio of a point splitting a line | 4 | 58 |

Join the community of 500,000 technology professionals and ask your questions.

Connect with top rated Experts

**10** Experts available now in Live!