C# Класс SGDE.Content.Code.Library.Math

The Math class contains methods and constants that represent common mathematical functions and values.
Наследование: Object
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
E Number
LN10 Number
LN2 Number
LOG10E Number
LOG2E Number
PI Number
SQRT1_2 Number
SQRT2 Number

Открытые методы

Метод Описание
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.

Описание методов

abs() публичный статический Метод

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.
Результат Number

acos() публичный статический Метод

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.
Результат Number

asin() публичный статический Метод

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.
Результат Number

atan() публичный статический Метод

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.
Результат Number

atan2() публичный статический Метод

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.
Результат Number

ceil() публичный статический Метод

Returns the ceiling of the specified number or expression.
public static ceil ( Number val ) : Number
val Number A number or expression.
Результат Number

cos() публичный статический Метод

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.
Результат Number

exp() публичный статический Метод

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.
Результат Number

floor() публичный статический Метод

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.
Результат Number

log() публичный статический Метод

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.
Результат Number

max() публичный статический Метод

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.
Результат Number

min() публичный статический Метод

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.
Результат Number

pow() публичный статический Метод

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.
Результат Number

random() публичный статический Метод

Returns a pseudo-random number n, where 0 >= n > 1.
public static random ( ) : Number
Результат Number

round() публичный статический Метод

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.
Результат Number

sin() публичный статический Метод

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.
Результат Number

sqrt() публичный статический Метод

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.
Результат Number

tan() публичный статический Метод

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.
Результат Number

Описание свойств

E публичное статическое свойство

A mathematical constant for the base of natural logarithms, expressed as e.
public static Number E
Результат Number

LN10 публичное статическое свойство

A mathematical constant for the natural logarithm of 10, expressed as loge10, with an approximate value of 2.302585092994046.
public static Number LN10
Результат Number

LN2 публичное статическое свойство

A mathematical constant for the natural logarithm of 2, expressed as loge2, with an approximate value of 0.6931471805599453.
public static Number LN2
Результат Number

LOG10E публичное статическое свойство

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
Результат Number

LOG2E публичное статическое свойство

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
Результат Number

PI публичное статическое свойство

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
Результат Number

SQRT1_2 публичное статическое свойство

A mathematical constant for the square root of one-half, with an approximate value of 0.7071067811865476.
public static Number SQRT1_2
Результат Number

SQRT2 публичное статическое свойство

A mathematical constant for the square root of 2, with an approximate value of 1.4142135623730951.
public static Number SQRT2
Результат Number