More mathimatical functions.

Moderator: GZDoom Developers

Richard213
Posts: 43
Joined: Sun Dec 05, 2004 1:35 pm

More mathimatical functions.

Post by Richard213 »

Considering the fact that zdoom has sin and cos, why isnt there tan? And why not expand that even further with more functions such as Atan, Atan2, Asin, Acos, and what ever else I forgot. :wink:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 47986
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Nobody needs that. cos and sin are needed to get a directional vector from an angle. Atan2 may be of use but the rest doesn't sound like something we need.
dennisj1
Posts: 399
Joined: Sun Jan 11, 2004 1:46 pm
Location: Superior, WI

Post by dennisj1 »

Tan (tangent) is defined as cos/sin (or is it sin/cos?), so you can derive it in ACS, anyway.
User avatar
Chris
Posts: 2841
Joined: Thu Jul 17, 2003 12:07 am
Operating System: Debian-like Linux (Debian, Ubuntu, Mint, etc) 64-bit
Graphics Processor: ATI/AMD with Vulkan Support

Post by Chris »

Still would be faster to have an opcode for it specificly. Since ACS is interpreted byte-code, it'd be faster to use one opcode for tan() than to fake it with two. Not to mention, libc could (and probably does) have special code to calculate the value faster and safer (simply doing cos(value)/sin(value) is asking for a crash if sin returns 0).

Return to “Closed Feature Suggestions”