# Analyse a tan calculation in LTSpice

#### Finn Cheng

Joined Apr 15, 2023
8
The resistance value is x, and its calculation formula is expressed below. If you use a computer to calculate x=1000*tan(pi/4+01)=15.45, so i=5/15.45=0.3236A, but this result is completely different from the picture , I don't know where the error in the simulation is now.

#### crutschow

Joined Mar 14, 2008
32,841
It's a little gotcha that's easy to forget about in using angles.
Your computer is using Degrees but Spice uses Radians for the angle.
Which are you intending?

Since you are using Pi as part of the angle value, I expect it's Radians.
If so, to get degrees for the computer calculation, multiply the Radian angle by 180/Pi.

Last edited:

#### Bordodynov

Joined May 20, 2015
3,084
(pi/4+01) !?

#### crutschow

Joined Mar 14, 2008
32,841

#### Bordodynov

Joined May 20, 2015
3,084
This is an attempt to draw attention to a mistake. That it needed 0.1 was perfectly clear to me.

#### Finn Cheng

Joined Apr 15, 2023
8
It's a little gotcha that's easy to forget about in using angles.
Your computer is using Degrees but Spice uses Radians for the angle.
Which are you intending?

Since you are using Pi as part of the angle value, I expect it's Radians.
If so, to get degrees for the computer calculation, multiply the Radian angle by 180/Pi.
Ok, I got it. Thank you so much!