Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Current »

Description

Returns the angle between two vectors, in degrees.

Functional area

Math

Command syntax

Syntax

getAngleTo vector1 vector2

Arguments

NameTypeRequiredComments
vector1vectoryesThis is an (unordered) input vector in getAngleTo
vector2vectoryesThis is an (unordered) input vector in getAngleTo

Flags

None

Return value

float

Returns the absolute value of the angle between vector1 and vector2

Examples

vector $v1 = <<1, 0, 0>>;
vector $v2 = <<0, 1, 0>>;
// show that getAngleTo returns the absolute value of the angle
// between two orthogonal vectors (90 degrees) regardless of
// ordering between vector1 and vector2
print( getAngleTo($v1, $v2)) ;
print( getAngleTo($v2, $v1)) ;

Additional information

Related commands

  • No labels