C# Class SGDE.Content.Code.Library.Math

The Math class contains methods and constants that represent common mathematical functions and values.
Inheritance: Object
Mostrar archivo Open project: sgdc/sgdc-old

Public Properties

Property Type Description
E Number
LN10 Number
LN2 Number
LOG10E Number
LOG2E Number
PI Number
SQRT1_2 Number
SQRT2 Number

Public Methods

Method Description
abs ( Number val ) : Number

Computes and returns an absolute value for the number specified by the parameter val.

acos ( Number val ) : Number

Computes and returns the arc cosine of the number specified in the parameter val, in radians.

asin ( Number val ) : Number

Computes and returns the arc sine for the number specified in the parameter val, in radians.

atan ( Number val ) : Number

Computes and returns the value, in radians, of the angle whose tangent is specified in the parameter val.

atan2 ( Number y, Number x ) : Number

Computes and returns the angle of the point y/x in radians, when measured counterclockwise from a circle's x axis (where 0,0 represents the center of the circle).

ceil ( Number val ) : Number

Returns the ceiling of the specified number or expression.

cos ( Number angleRadians ) : Number

Computes and returns the cosine of the specified angle in radians.

exp ( Number val ) : Number

Returns the value of the base of the natural logarithm (e), to the power of the exponent specified in the parameter x.

floor ( Number val ) : Number

Returns the floor of the number or expression specified in the parameter val.

log ( Number val ) : Number

Returns the natural logarithm of the parameter val.

max ( Number val1, Number val2 ) : Number

Evaluates val1 and val2 (or more values) and returns the largest value.

min ( Number val1, Number val2 ) : Number

Evaluates val1 and val2 (or more values) and returns the smallest value.

pow ( Number @base, Number pow ) : Number

Computes and returns base to the power of pow.

random ( ) : Number

Returns a pseudo-random number n, where 0 >= n > 1.

round ( Number val ) : Number

Rounds the value of the parameter val up or down to the nearest integer and returns the value.

sin ( Number angleRadians ) : Number

Computes and returns the sine of the specified angle in radians.

sqrt ( Number val ) : Number

Computes and returns the square root of the specified number.

tan ( Number angleRadians ) : Number

Computes and returns the tangent of the specified angle.

Method Details

abs() public static method

Computes and returns an absolute value for the number specified by the parameter val.
public static abs ( Number val ) : Number
val Number The number whose absolute value is returned.
return Number

acos() public static method

Computes and returns the arc cosine of the number specified in the parameter val, in radians.
public static acos ( Number val ) : Number
val Number A number from -1.0 to 1.0.
return Number

asin() public static method

Computes and returns the arc sine for the number specified in the parameter val, in radians.
public static asin ( Number val ) : Number
val Number A number from -1.0 to 1.0.
return Number

atan() public static method

Computes and returns the value, in radians, of the angle whose tangent is specified in the parameter val.
public static atan ( Number val ) : Number
val Number A number that represents the tangent of an angle.
return Number

atan2() public static method

Computes and returns the angle of the point y/x in radians, when measured counterclockwise from a circle's x axis (where 0,0 represents the center of the circle).
public static atan2 ( Number y, Number x ) : Number
y Number The y coordinate of the point.
x Number The x coordinate of the point.
return Number

ceil() public static method

Returns the ceiling of the specified number or expression.
public static ceil ( Number val ) : Number
val Number A number or expression.
return Number

cos() public static method

Computes and returns the cosine of the specified angle in radians.
public static cos ( Number angleRadians ) : Number
angleRadians Number A number that represents an angle measured in radians.
return Number

exp() public static method

Returns the value of the base of the natural logarithm (e), to the power of the exponent specified in the parameter x.
public static exp ( Number val ) : Number
val Number The exponent; a number or expression.
return Number

floor() public static method

Returns the floor of the number or expression specified in the parameter val.
public static floor ( Number val ) : Number
val Number A number or expression.
return Number

log() public static method

Returns the natural logarithm of the parameter val.
public static log ( Number val ) : Number
val Number A number or expression with a value greater than 0.
return Number

max() public static method

Evaluates val1 and val2 (or more values) and returns the largest value.
public static max ( Number val1, Number val2 ) : Number
val1 Number A number or expression.
val2 Number A number or expression.
return Number

min() public static method

Evaluates val1 and val2 (or more values) and returns the smallest value.
public static min ( Number val1, Number val2 ) : Number
val1 Number A number or expression.
val2 Number A number or expression.
return Number

pow() public static method

Computes and returns base to the power of pow.
public static pow ( Number @base, Number pow ) : Number
@base Number
pow Number A number specifying the power that the parameter base is raised by.
return Number

random() public static method

Returns a pseudo-random number n, where 0 >= n > 1.
public static random ( ) : Number
return Number

round() public static method

Rounds the value of the parameter val up or down to the nearest integer and returns the value.
public static round ( Number val ) : Number
val Number The number to round.
return Number

sin() public static method

Computes and returns the sine of the specified angle in radians.
public static sin ( Number angleRadians ) : Number
angleRadians Number A number that represents an angle measured in radians.
return Number

sqrt() public static method

Computes and returns the square root of the specified number.
public static sqrt ( Number val ) : Number
val Number A number or expression greater than or equal to 0.
return Number

tan() public static method

Computes and returns the tangent of the specified angle.
public static tan ( Number angleRadians ) : Number
angleRadians Number A number that represents an angle measured in radians.
return Number

Property Details

E public_oe static_oe property

A mathematical constant for the base of natural logarithms, expressed as e.
public static Number E
return Number

LN10 public_oe static_oe property

A mathematical constant for the natural logarithm of 10, expressed as loge10, with an approximate value of 2.302585092994046.
public static Number LN10
return Number

LN2 public_oe static_oe property

A mathematical constant for the natural logarithm of 2, expressed as loge2, with an approximate value of 0.6931471805599453.
public static Number LN2
return Number

LOG10E public_oe static_oe property

A mathematical constant for the base-10 logarithm of the constant e (Math.E), expressed as log10e, with an approximate value of 0.4342944819032518.
public static Number LOG10E
return Number

LOG2E public_oe static_oe property

A mathematical constant for the base-2 logarithm of the constant e, expressed as log2e, with an approximate value of 1.442695040888963387.
public static Number LOG2E
return Number

PI public_oe static_oe property

A mathematical constant for the ratio of the circumference of a circle to its diameter, expressed as pi, with a value of 3.141592653589793.
public static Number PI
return Number

SQRT1_2 public_oe static_oe property

A mathematical constant for the square root of one-half, with an approximate value of 0.7071067811865476.
public static Number SQRT1_2
return Number

SQRT2 public_oe static_oe property

A mathematical constant for the square root of 2, with an approximate value of 1.4142135623730951.
public static Number SQRT2
return Number