Math.js 687 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
/**
 * Created by JetBrains WebStorm.
 * User: Sergey.Luzyanin
 * Date: 2/24/12
 * Time: 10:06 AM
 * To change this template use File | Settings | File Templates.
 */
var cToRad = Math.PI/(60000*180);
var cToDeg = 1/cToRad;

function Cos(angle)
{
    return Math.cos(cToRad*angle);
}

function Sin(angle)
{
    return Math.sin(cToRad*angle);
}

function Tan(angle)
{
    return Math.tan(cToRad*angle);
}

function ATan(x)
{
    return cToDeg*Math.atan(x);
}

function ATan2(y, x)
{
    return  cToDeg*Math.atan2(y, x);
}

function CAt2(x, y, z)
{
    return  x*(Cos(ATan2(z, y)));
}

function SAt2(x, y, z)
{
    return  x*(Sin(ATan2(z, y)));
}