Hello, I would like to find the inverse tangent of a distance, taken between two points.
I have my variables “dist” and “tube” filled, and my code finished like this:
angle = Atan (dist / tube) * 180 / PI ()
a line found on the net … but necessarily, it does not work …
is there a solution?
is it necessary to call on another function? bibli?
I answered your question on the Rhinoshack forum, but for those who are watching, I will post it here as well -
The main problem is that you need to use ‘atn’ with VB Rhinoscript and not ‘Atan’. Using ‘math.atan’ (no capital) is correct for Python though. The following works for VB Rhinoscript:
a = Rhino.CurveLength(Rhino.GetObject("Pick CYAN line", 4))
b = Rhino.CurveLength(Rhino.GetObject("Pick RED line", 4))
Rhino.Print "Length of a=" & Cstr(a)
Rhino.Print "Length of b=" & Cstr(b)
angle = atn(a / b)
Rhino.Print "Angle in radians=" & Cstr(angle)
Rhino.Print "Angle in degrees=" & Cstr(angle * (180 / Rhino.PI))
3-4-5.3dm (233.4 KB)