Page 2 of 4

Re: Panicky Commuter

Posted: Tue Aug 30, 2011 6:26 am
by XQYZ
Why the hell would you write your own sine function if you can just use math.sin? You just have to give it the degree in rad (multiply by 2*pi/360 if you didn't pay attention in math class).

Re: Panicky Commuter

Posted: Tue Aug 30, 2011 7:43 am
by T-Bone
XQYZ wrote:Why the hell would you write your own sine function if you can just use math.sin? You just have to give it the degree in rad (multiply by 2*pi/360 if you didn't pay attention in math class).
For fun? :P

Re: Panicky Commuter

Posted: Tue Aug 30, 2011 9:22 am
by Robin
XQYZ wrote:You just have to give it the degree in rad (multiply by 2*pi/360 if you didn't pay attention in math class).
Why the hell would you convert to radians manually if you can just use math.rad?

:P

Re: Panicky Commuter

Posted: Tue Aug 30, 2011 12:10 pm
by T-Bone
Robin wrote:
XQYZ wrote:You just have to give it the degree in rad (multiply by 2*pi/360 if you didn't pay attention in math class).
Why the hell would you convert to radians manually if you can just use math.rad?

:P
Didn't know about that one :neko:

Re: Panicky Commuter

Posted: Tue Aug 30, 2011 1:45 pm
by XQYZ
T-Bone wrote:
Robin wrote:
XQYZ wrote:You just have to give it the degree in rad (multiply by 2*pi/360 if you didn't pay attention in math class).
Why the hell would you convert to radians manually if you can just use math.rad?

:P
Didn't know about that one :neko:
neither did I, but I guess you learn something new all the time. However, the effort of converting deg to rad is comparably low compared to implementing trigonometric functions ;)

Re: Panicky Commuter

Posted: Tue Aug 30, 2011 6:45 pm
by tentus
Fun times. A couple more difficulty options would be fantastic.

Also, here's a low-hanging fruit: you can gain just a tiny bit of performance very easily by disabling features in conf.lua. For example, you can set t.modules.joystick and t.modules.physics to false. Instant reduction of startup time (slightly) and reduction of memory usage (again, slightly).

Re: Panicky Commuter

Posted: Tue Aug 30, 2011 6:49 pm
by GijsB
XQYZ wrote:
T-Bone wrote:
Robin wrote:
Why the hell would you convert to radians manually if you can just use math.rad?

:P
Didn't know about that one :neko:
neither did I, but I guess you learn something new all the time. However, the effort of converting deg to rad is comparably low compared to implementing trigonometric functions ;)
how do radians work actualy >_>?

(i live in europe so i only use degrees)

Re: Panicky Commuter

Posted: Tue Aug 30, 2011 6:58 pm
by T-Bone
Who says we don't use radians in Europe? What nonsense is this?

Radians is a unit for measuring angles that has several mathematical benefits. A full circle is 2*pi.

Re: Panicky Commuter

Posted: Tue Aug 30, 2011 7:18 pm
by Robin
GijsB wrote:(i live in europe so i only use degrees)
Dude, seriously. Radians is an international standard, like meters and seconds.

Oh, and T-Bone is right. For more information see Dutch Wikipedia.

Re: Panicky Commuter

Posted: Tue Aug 30, 2011 7:24 pm
by XQYZ
T-Bone wrote:Who says we don't use radians in Europe? What nonsense is this?
Same. Even our school calculators required input in rad. It's actually a much more logical unit of measurement when it comes to angles since you can derive it from a circle whereas the 360 degrees are purely arbitrary and could as-well be 500 degrees. The only thing that makes it highly impractical is that it relies on the irrational number pi, so you either have to save fractions of pi or deal with inaccuracy.