Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

GDL Trigonometry question

Mats_Knutsson
Expert

Hi,

I have a label where i move the marker around freely through hotspots (xins and yins).

I don't understand how to code the line to stop at the perimeter of the circle. If I knew how ATAN works I could do this but i get an error when trying to use ATAN.

Br,

Mats

 

 

gdl atan.jpg

AC 24 SWE Full
HPZbook 32GB i7 7820HQ 2,9 GHz
Quadro M2200 2GB
1 ACCEPTED SOLUTION

Solution
DGSketcher
Virtuoso

@Mats_Knutsson See if this works after your hotspots...

dLine = SQR(xIns^2 + yIns^2) - rsp
IF xIns > 0 THEN aLine = ATN(yIns / xIns) ELSE aLine = ATN(yIns / xIns) + 180
LINE2 0,0, dline * COS(aLine), dLine * SIN(aLine)
CIRCLE2 xIns, yIns, rsp
TEXT2 xIns, yIns, stName
Apple iMac macOS Big Sur / AC24UKI (most recent builds)

View solution in original post

5 REPLIES 5

Gegenkathete / Ankathete = TAN(alfa)

alfa = ATN(Gegenkathete / Ankathete)

Joachim Suehlo . AC12-25 . MAC OSX 10.15 . WIN10

Zsuzsanna Bori
Graphisoft
Graphisoft

Hi! 

 

If I understood correctly, you would like to get the arc tangent of x, but you get an error message, correct? The function uses the argument "ATN" instead of "ATAN", see if you get the desired outcome with that.

 

Ah...I read a doc where it was ATAN. Will try ATN instead. Thx

AC 24 SWE Full
HPZbook 32GB i7 7820HQ 2,9 GHz
Quadro M2200 2GB

Solution
DGSketcher
Virtuoso

@Mats_Knutsson See if this works after your hotspots...

dLine = SQR(xIns^2 + yIns^2) - rsp
IF xIns > 0 THEN aLine = ATN(yIns / xIns) ELSE aLine = ATN(yIns / xIns) + 180
LINE2 0,0, dline * COS(aLine), dLine * SIN(aLine)
CIRCLE2 xIns, yIns, rsp
TEXT2 xIns, yIns, stName
Apple iMac macOS Big Sur / AC24UKI (most recent builds)

View solution in original post

Gr8 thanks 🙂

 

https://youtu.be/NPs0vPolWhs

AC 24 SWE Full
HPZbook 32GB i7 7820HQ 2,9 GHz
Quadro M2200 2GB

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!