Log In  

where is it ? I'm stumped. and a little angry.
<- that's really my face right now.

P#28603 2016-09-16 12:19 ( Edited 2016-09-17 01:15)

function tan(a) return sin(a)/cos(a) end
P#28604 2016-09-16 12:27 ( Edited 2016-09-16 16:27)

You can probably just use this:

function tan(x) return sin(x) / cos(x) end

← that’s not really my face

P#28605 2016-09-16 12:28 ( Edited 2016-09-16 16:28)

thanks, I know that. more tokens, more cycles.

P#28606 2016-09-16 12:29 ( Edited 2016-09-16 16:30)

Maybe there is another way around? Game programmers almost never need tan() in real life, so if you were to show some of the code around where you use it, someone may help simplify it?

P#28609 2016-09-16 13:17 ( Edited 2016-09-16 17:17)

thanks samhocevar, but it's not about that, I don't need it that bad. sin/cos will do.

but, you know, cos(x) is just sin(x+0.25)(*). so let's ditch cos.
who needs tan(), ceil() and round()? who needs standards anyway?
good riddance, we need room for... for what exactly?

that's not clean. on purpose. why the hatred for math?

(*) wait, no, btw, sin is inverted for some silly reason.

P#28623 2016-09-16 17:57 ( Edited 2016-09-16 21:57)

"so let's ditch cos. who needs tan(), ceil() and round()"

In all seriousness, I've wondered the same thing. :p I mean it's not like Pico 8 has hyperbolic trig functions, erf(), or floating point numbers even!

I think it's struck an OK balance between leaving out functions you'll probably never need in a game (like erf), and writing your own trig functions (which is hard).

P#28632 2016-09-16 21:15 ( Edited 2016-09-17 01:15)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 21:39:53 | 0.009s | Q:19