Skip to main content
gamedev.net
🔒 Locked

COT?

Started by Axiverse 5 replies 2.5k views
Original Post
Axiverse
Axiverse
err... there is no cotangent anywhere in math.h... or is there? does anyone know where there is a function for this?
ontheheap
ontheheap
Doesn't math.h have a tan() function?


x = 1 / tan (radians);


And if there is no tan() function just subsitute:



x = ( 1 / ( sin(radians) / cos(radians) ) );
MikaelBrandin
MikaelBrandin
Perhaps you should pick up a book calculus on your way home tomorrow because programming games need a LOT of math.

Sorry for the information most people don't want to face this but it's true. Math has a meaning in life.

Good Luck!
mikbra @ Chalmers Unniversity of TechnologyGothenburg, SwedenInformation Technology - department of Computer ScienceMaster of Science
Sneftel
Sneftel
Quote:
Original post by MikaelBrandin
Perhaps you should pick up a book calculus on your way home tomorrow because programming games need a LOT of math.
Where did Axiverse imply in any way whatsoever that he didn't think game programming involved math? Seems to me that he's explicitly asking about math.
Thygrrr
Thygrrr
As a matter of fact, asking for cotangent implies quite a bit of understanding of math :) You don't use that every day as a beginner!
sporff
sporff
Quote:
Original post by ontheheap
x = ( 1 / ( sin(radians) / cos(radians) ) );


of course if you're doing it that way you can simplify that to just:
x = cos(radians) / sin(radians);

Of course 1/tan is better like you said. weird, I never realized there's not a cot function. Learn somethin new everyday!
Axiverse
Axiverse
Yeah, I know the formula, but I was just wondering if there was a function, but thanks anyways!

[ working in matrix projections and stuff ]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.