ABG
November 4, 2020, 4:10pm
21
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:

TIMAI2
November 4, 2020, 4:20pm
22
The link is in post #2 of this topic

ABG
November 4, 2020, 6:40pm
23
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
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

TIMAI2
November 6, 2020, 4:09pm
26
Just set the line width/colour for each line you draw...?

system
Closed
November 13, 2020, 4:15pm
27
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.