Author Topic: Sin calculation error.  (Read 1079 times)

So, I'm working on calculator commands, here is the code I wrote for /calc sin <number> rad
[img]http://i.imgur.com/VBALV.png[ /img]
I type /calc sin 1 rad, it says this back:
CC (Sin): Sin(1) = 1

halp!!11!


User is thankful for the help in this post.
« Last Edit: October 15, 2012, 07:09:04 PM by Subpixel »

Code from server.cs:
Code: [Select]
else
{
if(%calcfunc $= "sin")
{
if(%a >= 1)
{
        %c = %a;
mSin(%a);
if(%b $= "rad")
{
messageclient(%client, '', '<color:ffffff>CC (Sin): \c2Sin(%1) <color:ffffff>= \c2%2', %c, %a);
}

}

... why the hell did you put the code as an image...

is it possible the function is mSine()?

... why the hell did you put the code as an image...

is it possible the function is mSine()?
No

it says that in mSine(val), val is a number between negative pi and positive pi.


i see no error checking for this info.

it says that in mSine(val), val is a number between negative pi and positive pi.


i see no error checking for this info.
Tried mSine, still told me Sin(1) = 1.

mSin(%a); to %a = mSin(%a);
mSin doesn't set %a to the sine of %a, it returns the sine of %a, so you must set %a to it.

your latest post does not address the concerns raised in my latest post.
mSin(%a); to %a = mSin(%a);
mSin doesn't set %a to the sine of %a, it returns the sine of %a, so you must set %a to it.
i totally missed this like a tard

oops.

anyway, my point still stands.

mSin(%a); to %a = mSin(%a);
mSin doesn't set %a to the sine of %a, it returns the sine of %a, so you must set %a to it.
Thank you. I had that last time I coded sin but forgot.

it says that in mSine(val), val is a number between negative pi and positive pi.


i see no error checking for this info.
==>mSine();
<input> (0): Unable to find function mSine

Be very cautious that Torque uses radians for trigonometric operations.

Do mSin(mDegToRad(%val))


Be very cautious that Torque uses radians for trigonometric operations.

Do mSin(mDegToRad(%val))
He knows this already