3D Lingo Dictionary > C-D > cross |  |

cross

Syntax

    vector1.cross(vector2)

Description

3D vector method; returns a vector which is perpendicular to both `vector1` and `vector2`.

Example

In this example, pos1 is a vector on the x axis and pos2 is a vector on the y axis. The value returned by `pos1.cross(pos2)` is `vector( 0.0000, 0.0000, 1.00000e4 )`, which is perpendicular to both pos1 and pos2.

    pos1 = vector(100, 0, 0)
    pos2 = vector(0, 100, 0)
    put pos1.cross(pos2)
    -- vector( 0.0000, 0.0000, 1.00000e4 )

See also

`crossProduct()`, `perpendicularTo`