hello all i need to get the tangent of a circle command into a programe as follows tan (angle of degree/2)

trying just 90degrees /2 =45degrees tan(45) in intermediate window i get 1.619 which is radians , to convert to degrees its 180/pi (3.142) but this gives result of 92.806. rather than 1

if using windows calculator tan 45 =1 which is correct, but have tried all ways to try and get tan command to give the same result , so how can this be done.

thank you

The tan function is expecting the argument to be in radians so convert your 45 degrees to radians before doing the tan. You can confirm this in windows calculator by setting the units to RAD and doing a tan of 45. Hey presto it gives you 1.619 :mrgreen:

commented: Nice Response +1

thanks mark
i was trying to turn tan 45=1.6 radians and then convert to degrees the book i have does not make the fact you have to turn say 45 degrees into (radians first) then do tan command that clear.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.