Skip to main content
Oxidozer
Known Participant
May 14, 2024
Answered

Calculating inverse trigonometry functions

  • May 14, 2024
  • 1 reply
  • 291 views

How would one go about setting up nodes to calculate the inverse of sin, cos, tan? I need to draw triangles where I will only know two sides and their shared angle, and I'm using the Law of Sines to calculate the third side.

This topic has been closed for replies.
Correct answer Luca Giarrizzo

Hello,

 

Function graphs offer the acos (arccos) and asin (arcsin) inverse trigonometric functions as instance nodes. atan (arctan) is not implemented natively.

 

Arc Tangent 2 (atan2 or arctan2) is also available as an atomic node. Note that it is not necessary to switch the X and Y component of the input vector as in the usual atan2 function.

 

That said, to compute the length of the opposite side BC of an ABC triangle where and angle 'a' and its two adjacent sides AB and AC are known, you may consider splitting that triangle into two right triangles: ABD and BCD.

 

Then:

 

AD = AB*cos(a)
BD = AB*sin(a)
CD = AC - AD
=> BC = sqrt(BD^2 + CD^2)

 

 

I hope this makes sense! Here is a simple implementation and its result:

(the graph outputs -1 if any of the input values is 0 or lower)

 

 

Best regards.

1 reply

Luca Giarrizzo
Community Manager
Luca GiarrizzoCommunity ManagerCorrect answer
Community Manager
May 16, 2024

Hello,

 

Function graphs offer the acos (arccos) and asin (arcsin) inverse trigonometric functions as instance nodes. atan (arctan) is not implemented natively.

 

Arc Tangent 2 (atan2 or arctan2) is also available as an atomic node. Note that it is not necessary to switch the X and Y component of the input vector as in the usual atan2 function.

 

That said, to compute the length of the opposite side BC of an ABC triangle where and angle 'a' and its two adjacent sides AB and AC are known, you may consider splitting that triangle into two right triangles: ABD and BCD.

 

Then:

 

AD = AB*cos(a)
BD = AB*sin(a)
CD = AC - AD
=> BC = sqrt(BD^2 + CD^2)

 

 

I hope this makes sense! Here is a simple implementation and its result:

(the graph outputs -1 if any of the input values is 0 or lower)

 

 

Best regards.

Luca Giarrizzo | Quality Engineer, 3D & Immersive | Adobe