iLogic difference in calculating TAN with degrees and mm

iLogic difference in calculating TAN with degrees and mm

Anonymous
Not applicable
3,547 Views
4 Replies
Message 1 of 5

iLogic difference in calculating TAN with degrees and mm

Anonymous
Not applicable

Good morning World!

 

I am currently trying to make a calculation with Tangent with degrees. I get a different outcome while working mm.

For example:

 

Height = 1000 mm

Angle = 50 deg

X = Height / TAN(Angle) = 642,092615934331 mm

 

While adding another parameter, with the angle being in mm I get a different outcome.

For example:

 

Height = 1000 mm

Angle = 50 deg

Angle = Angle_mm

X = Height / TAN(Angle_mm) = 617,369623783555 mm

 

 

I need the TAN to work the same way as it would in mm as with degrees.

Anyone knows a solution for this, or am I doing something wrong here?

 

Regards,

Mark

0 Likes
Accepted solutions (1)
3,548 Views
4 Replies
Replies (4)
Message 2 of 5

swalton
Mentor
Mentor

For iLogic:

All trig functions use radians.  You will have to convert all your angle measurements to rad before using them in a trig function.  Also, trig functions require angle measures, not length measures. Tan(2 rad) works.  Tan(2 mm) is wrong. 

 

See http://help.autodesk.com/view/INVNTOR/2014/ENU/?guid=GUID-E9CF6373-3E22-4E25-9F1D-49B8602A8EC0

 

For parameters:

All trig functions in Inventor expect an angle unit.  Angles are measured in deg, radians, grad, or steradians.  Tan(deg) or Tan(rad) are valid. Tan(mm) or tan(inches) are not. 

 

See the attached screenshot.  IV returns a value for tan(inches) but it is highlighted in red to show that the units are not correct.  Also, the calculated value is not the same as the tan(deg) or the tan(rad) calculations.  I don't know why Inventor calculates anything when the units are wrong.  I think it should throw an error and force you to fix it before you can close the parameters window.

 

Re-work your equation to use an angle unit for your normal trig functions and unitless values for your inverse trig functions.

 

Edited to show difference between ilogic and parameters.

Steve Walton
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Inventor 2025
Vault Professional 2025
Message 3 of 5

Anonymous
Not applicable
Thanks for your reply, and clarification. It kind of makes sense now.

I tried mm because my outcome in degrees wasn't correct for some reason, and still isn't. I'll try the unitless solution now and hope it works as I'd like.

Thanks for the time to work this out 🙂
0 Likes
Message 4 of 5

Anonymous
Not applicable
Still isn't working as intended. I mean it still does the same thing with unitless as with degrees

Basically I use parameters with both angle and length measurements, mm and degrees.

I'll show you a similair example with parameters that are a little clearer, because my language isn't English.

Slope = StairRise / Sin(Angle)

Slope = mm
StairRise = mm
Angle = deg

It's just a simple formula but it's not giving me the same outcome as it would on my calculator. I'm also working in an assembly level, linking parameters from parts to my main User Parameter in the main assembly. I don't know where it's going wrong.

I could send a screenshot but it's not going to make things any clearer since they are random names.
0 Likes
Message 5 of 5

Anonymous
Not applicable
Accepted solution

Okay so I found out the solution. 

 

Apparantely Inventor calculates in Rad, EVEN when your Document Dettings are set to Deg.

Therefore my angle was calculated in Rad and not in Deg inside iLogic, which caused my problem. I just had to convert the Rad to Deg and it solved my problem.

 

Problem:

 Slope = SlopeIncline / Sin(Angle)

 Solution: 

 Slope = SlopeIncline / Sin(Angle*PI/180)

 

Thanks for your advice, definately helped me to figure it out.