Draw lines and measure angles

The first section of your code computes some tangents, and drops them into variables with 2-letter names.

The special case you are complaining about might cause negative tangent values, which you can test for before deciding how to calculate your angles.

I am unfamiliar with the formula you use for calculating angles, with the "1 + tan()*tan()" denominator. Can you post a link to its derivation?

If your formula response is out of range but can be normalized, here are some normalization routines in this sample app:

The link is in post #2 of this topic

I see three Notes between the formula derivation and examples at

One of the notes warns against bad results if one of the lines is parallel to one of the axes.

For a really limber cyclist, I would fall back to a solution using the atan2 function, which is less susceptible to infinite slopes.

Thanks for all the usefull info. I will work through them and get to a solution :slight_smile:
Time to use more brain power

Is there a way to have two linetypes on a canvas. I see you can change the line weight colour ect, but that applies to all the lines. I need to have two line types.
Thanks

Just set the line width/colour for each line you draw...?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.