Banner Image

Module Core.Vector

CORE - Vector algebra.

Main Features:

  • Easy vector algebra function
  • Redefinition of +, -, *, /, % operators to be compatible with vectors
  • Interface to DCS API functions
  • Reduced confusion of DCS coordinate system
  • Better performance than related classes (COORDINATE, POINT_VEC)

Example Missions:

Demo missions can be found on github.


Author: funkyfranky


Global(s)

Global VECTOR

Mathematics knows no races or geographic boundaries; for mathematics, the cultural world is one country. --David Hilbert


The VECTOR Concept

The VECTOR class has a great concept!

https://github.com/automattf/vector.lua/blob/master/vector.lua

The DCS Coordinate System

DCS has a rather unconventional way to define the coordinate system.

#VECTOR VECTOR

Mathematics knows no races or geographic boundaries; for mathematics, the cultural world is one country. --David Hilbert


The VECTOR Concept

The VECTOR class has a great concept!

https://github.com/automattf/vector.lua/blob/master/vector.lua

The DCS Coordinate System

DCS has a rather unconventional way to define the coordinate system.

The definition even depends whether you work with a 2D vector or a 3D vector. The good think is, that you usually do not need to worry about this unless you directly call the DCS API functions. Plus, this class tries to hide the differences between 2D and 3D conventions as good as possible with internal if-cases.

Still, it is important to unterstand the differences. So let us explain:

Usually, we draw a coordinate system in 2D and label the horizonal axis (pointing right) as the x-axis. The vertical axis (poining up on a piece of paper)

3D

The x-axis points North. The z-axis points East. The y-axis points upwards and defines the altitue with respect to the mean sea level.

2D

The x-axis points North (just like in the 3D) case. The y-axis points East.

Constructors

There are different ways to create a new instance of a VECTOR. All methods start with New.

From Components

From 2D or 3D Vectors

From Polar Coordinates

From Spherical Coordinates

Operators

Addition [MATH] +

Subtraction [MATH] -

Multiplication [MATH] *

Devision [MATH] /

Modulo [MATH] %

DCS API Interface

This class offers easy and convenient ways to access all vector related DCS API functions.

Land and Surface

Atmosphere

Effects and Actions

Map Markings

Coordinates

Inferface to other MOOSE Classes

Of course, this class is interfaced with other MOOSE classes in the sense that you can obtain and work with VECTOR instances from MOOSE objects, from which a position or direction vector can be derived.

GROUP

UNIT

STATIC

SCENERY

ZONE

Examples

A new VECTOR object can be created with the VECTOR.New function. Here we create two vectors, a and b, and add them to create a new vector c.

local a=VECTOR:New(1, 0)
local b=VECTOR:New(0, 1)
local c=a+b

This is how it works.

Global _VECTORID

VECTOR unique ID

#number _VECTORID

VECTOR unique ID

Type(s)

Fields and Methods inherited from VECTOR Description

VECTOR:AddVec(Vec)

Add a vector to this.

VECTOR:ArrowTo(Vector, Coalition, Color, FillColor, LineType)

Creates a arrow from this VECTOR to another vector on the F10 map.

VECTOR.ClassName

Name of the class.

VECTOR:Copy()

Get a clone (deep copy) of this vector.

VECTOR:Dot(Vec)

Calculate the dot product of this VECTOR with another vector.

VECTOR:Explosion(Power)

Creates an explosion at a given point at the specified power.

VECTOR:Flare(Color, Azimuth)

Creates a signal flare at the given point in the specified color.

VECTOR:GetClosestRailroad()

Get a vector on the closest railroad.

VECTOR:GetClosestRoad()

Get a vector on the closest road.

VECTOR:GetCoordinate(OnSurface)

Get a COORDINATE object.

VECTOR:GetDirectionalVectorFrom(a)

Get the directional vector that points from another VECTOR a to this VECTOR.

VECTOR:GetDirectionalVectorTo(a)

Get the directional vector that points from this VECTOR to another VECTOR a.

VECTOR:GetDistance(Vector, Only2D)

Get the distance from this vector to another vector.

VECTOR:GetHeading(To360)

Get heading of vector.

VECTOR:GetHeadingDelta(Vector)

Get the difference of the heading of this vector w.

VECTOR:GetHeadingFrom(Vector)

Get the heading from a given vector to this vector.

VECTOR:GetHeadingTo(Vector)

Get the heading from this vector to another given vector.

VECTOR:GetInterceptPoint(DirectionVector, Distance)

Returns an intercept point at which a ray drawn from the this vector in the passed normalized direction for a specified distance.

VECTOR:GetIntermediateVector(Vector, Fraction)

Return an intermediate VECTOR between this and another given vector.

VECTOR:GetLatitudeLongitude()

Get latitude and longitude of this vector.

VECTOR:GetLength()

Get length/norm/magnitude of this vector.

VECTOR:GetMGRS()

Get MGRS information of this vector.

VECTOR:GetPathOnRoad(Vec)

Get the path on road from this vector to a given other vector.

VECTOR:GetProfile(Vec3)

Get profile of the land between the two passed points.

VECTOR:GetSurfaceHeight()

Returns the distance from sea level at this vector.

VECTOR:GetSurfaceHeightAndDepth()

Returns the distance from sea level at this vector.

VECTOR:GetSurfaceType()

Get the surface type at the vector.

VECTOR:GetSurfaceTypeName()

Get the name of surface type at the vector.

VECTOR:GetTemperaturAndPressure()

Returns a temperature and pressure at this vector.

VECTOR:GetVec2()

Get 2D vector as simple table.

VECTOR:GetVec3(OnSurface)

Get 3D vector as simple table.

VECTOR:GetWindVector(WithTurbulence)

Returns a velocity vector of the wind at this vector.

VECTOR:IlluminationBomb(Power, Altitude)

Creates an illumination bomb at the specified point.

VECTOR:IsVisible(Vec)

Check if a given vector has line of sight with this vector.

VECTOR:Mark(MarkText, Recipient, ReadOnly)

Create mark on F10 map.

VECTOR:New(x, y, z)

Create a new VECTOR class instance from given cartesian coordinates x, y and z, where z is optional.

VECTOR:NewDirectionalVector(a, b)

Get the directional vector that points from a given vector a to another given vector b.

VECTOR:NewFromLLDD(Latitude, Longitude, Altitude)

Creates a new VECTOR instance from given the latitude and longitude in decimal degrees (DD).

VECTOR:NewFromLLDMS(Latitude, Longitude, Altitude)

Creates a new VECTOR instance from given latitude and longitude in degrees, minutes and seconds (DMS).

VECTOR:NewFromPolar(r, phi)

Create a new VECTOR class instance from polar coordinates (r, phi).

VECTOR:NewFromSpherical(r, theta, phi)

Create a new VECTOR class instance from spherical coordinates (r, theta, phi).

VECTOR:NewFromVec(Vec)

Create a new VECTOR class instance from given 2D or 3D vector object.

VECTOR:Normalize()

Normalize this vector, so that has a length of 1.

VECTOR:Replace(Vector, Project2D)

Replace this vector with another one.

VECTOR:Rot(Vec)

Calculate the rotation or cross product of this VECTOR with another vector.

VECTOR:Rotate2D(Angle, Copy)

Rotate the VECTOR clockwise in the 2D (x,z) plane.

VECTOR:SetLength(Length)

Set length/norm/magnitude of this vector.

VECTOR:SetX(x)

Set x-component of vector.

VECTOR:SetY(y)

Set y-component of vector.

VECTOR:SetZ(z)

Set z-component of vector.

VECTOR:Smoke(Color, Duration)

Creates a smoke at this vector.

VECTOR:SmokeAndFire(Preset, Density, Duration)

Creates a large smoke and fire effect of a specified type and density at this vector.

VECTOR:StopSmoke(Name, Delay)

Stop smoke or fire effect.

VECTOR:SubVec(Vec)

Subtract a vector from this one.

VECTOR:ToStringMGRS(Settings)

Provides an MGRS string.

VECTOR:Translate(Distance, Heading, Copy)

Translate the vector by a given distance and angle.

VECTOR._IsVector(t)

Check if passed object is a Vector.

VECTOR.__add(a, b)

Meta function to add vectors together.

VECTOR.__div(a, b)

Meta function for dividing a vector by a scalar or by another vector.

VECTOR.__eq(a, b)

Meta function to check if two vectors are equal.

VECTOR.__index

VECTOR private index.

VECTOR.__mul(a, b)

Meta function to multiplicate vector by another vector or a scalar.

VECTOR.__sub(a, b)

Meta function to subtract vectors.

VECTOR:__tostring()

Meta function to change how vectors appear as string.

VECTOR.__unm(v)

Meta function to make vectors negative.

VECTOR.uid

VECTOR.verbose

Verbosity of output.

VECTOR.version

VECTOR class version.

VECTOR.x

Component pointing North if > 0 and South if < 0.

VECTOR.y

Component pointing up if >0 and down if < 0. This describes the altitude above main sea level.

VECTOR.z

Component pointing East if > 0 and West if < 0.

VECTOR class.

Field(s)

#string VECTOR.ClassName

Name of the class.

#VECTOR VECTOR.__index

VECTOR private index.

#number VECTOR.verbose

Verbosity of output.

#string VECTOR.version

VECTOR class version.

#number VECTOR.x

Component pointing North if > 0 and South if < 0.

#number VECTOR.y

Component pointing up if >0 and down if < 0. This describes the altitude above main sea level.

#number VECTOR.z

Component pointing East if > 0 and West if < 0.

Function(s)

Add a vector to this.

This function works for DCS#Vec2, DCS#Vec3, VECTOR, COORDINATE objects. Note that if you want to add a VECTOR, you can also simply use the + operator.

Defined in:

VECTOR

Parameter:

DCS#Vec3 Vec

Vector to add. Can also be a DCS#Vec2, DCS#Vec3, COORDINATE or VECTOR object.

Return value:

self

Creates a arrow from this VECTOR to another vector on the F10 map.

Defined in:

VECTOR

Parameters:

#VECTOR Vector

The vector defining the endpoint.

#number Coalition

Coalition Id: -1=All, 0=Neutral, 1=Red, 2=Blue. Default -1.

#table Color

RGB color with alpha {r, g, b, alpha}. Default {1, 0, 0, 0.7}.

#table FillColor

RGB color with alpha {r, g, b, alpha}. Default {1, 0, 0, 0.5}.

#number LineType

Line type: 0=No line, 1=Solid, 2=Dashed, 3=Dotted, 4=Dot Dash, 5=Long Dash, 6=Two Dash. Default 1.

Return value:

#number:

Marker ID. Can be used to remove the drawing.

Get a clone (deep copy) of this vector.

Defined in:

VECTOR

Return value:

Copy of the vector.

Calculate the dot product of this VECTOR with another vector.

This function works for DCS#Vec2, DCS#Vec3, VECTOR, COORDINATE objects.

Defined in:

VECTOR

Parameter:

DCS#Vec3 Vec

The other vector. Can also be a DCS#Vec2, DCS#Vec3, COORDINATE or VECTOR object.

Return value:

#number:

Dot product Sum_i(a[i]*b[i]). Note that this is a scalar and not a vector any more!

Creates an explosion at a given point at the specified power.

Defined in:

VECTOR

Parameter:

#number Power

The power in kg TNT. Default 100 kg.

Return value:

self

Creates a signal flare at the given point in the specified color.

The flare will be launched in the direction of the azimuth angle.

Defined in:

VECTOR

Parameters:

#number Color

Color of flare. Default Green.

#number Azimuth

Azimuth angle in degrees. Default 0.

Return value:

self

Get a vector on the closest railroad.

Defined in:

VECTOR

Return value:

Closest vector to a railroad.

Get a vector on the closest road.

Defined in:

VECTOR

Return value:

Closest vector to a road.

Get a COORDINATE object.

Defined in:

VECTOR

Parameter:

#boolean OnSurface

If true, the y component is set the land height [m] of the 2D position.

Return value:

The COORDINATE object.

Get the directional vector that points from another VECTOR a to this VECTOR.

Defined in:

VECTOR

Parameter:

Vector a. This can also be given as any table with x,y and z components (z optional).

Return value:

Directional vector from self to a.

Get the directional vector that points from this VECTOR to another VECTOR a.

Defined in:

VECTOR

Parameter:

Vector a. This can also be given as any table with x, y and z components, where z is optional.

Return value:

Directional vector from this vector to a.

Get the distance from this vector to another vector.

Defined in:

VECTOR

Parameters:

#VECTOR Vector

Vector to which the distance is requested.

#boolean Only2D

If true, calculate only the projected 2D distance.

Return value:

#number:

Distance in meters.

Get heading of vector.

Note that a heading of

  • 000° = North
  • 090° = East
  • 180° = South
  • 270° = West.

Defined in:

VECTOR

Parameter:

#boolean To360

If true or nil, adjust heading to [0,360) range. If false, headings not in this range can occur.

Return value:

#number:

Heading in degrees.

Get the difference of the heading of this vector w.

Example 1: This vector has a heading of 90° (pointing East) and the other vector has a heading of 225° (pointing South-West), we would optain a delta of 225°-90°=135°.

Example 2: This vector has a heading of 180 (pointing South) and the other vector has a heading of 90° (pointing East), we would optain a delta of 90°-180°=-90°.

Defined in:

VECTOR

Parameter:

#VECTOR Vector

Vector to which the heading is requested.

Return value:

#number:

Heading from this vector to the other vector in degrees.

Get the heading from a given vector to this vector.

Defined in:

VECTOR

Parameter:

#VECTOR Vector

Vector from which the heading is requested.

Return value:

#number:

Heading from the other vector to this vector in degrees.

Get the heading from this vector to another given vector.

Defined in:

VECTOR

Parameter:

#VECTOR Vector

Vector to which the heading is requested.

Return value:

#number:

Heading from this vector to the other vector in degrees.

Returns an intercept point at which a ray drawn from the this vector in the passed normalized direction for a specified distance.

Defined in:

VECTOR

Parameters:

DCS#Vec3 DirectionVector

Directional vector.

#number Distance

Distance in meters. Default 1000 m.

Return value:

Intercept vector. Can be nil if no intercept point is found.

Return an intermediate VECTOR between this and another given vector.

Defined in:

VECTOR

Parameters:

#VECTOR Vector

The destination vector.

#number Fraction

The fraction (0,1) where the new vector is created. Default 0.5, i.e. in the middle.

Return value:

Vector between this and the other vector.

Get latitude and longitude of this vector.

Defined in:

VECTOR

Return values:

#number:

Latitude in decimal degrees (DD).

#number:

Longitude in decimal degrees (DD).

Get length/norm/magnitude of this vector.

Defined in:

VECTOR

Return value:

#number:

Length of vector.

Get MGRS information of this vector.

MGRS = {UTMZone = string, MGRSDigraph = string, Easting = number, Northing = number}

Defined in:

VECTOR

Return value:

#table:

MGRS table with UTMZone, MGRSDiGraph, Easting and Northing keys.

Get the path on road from this vector to a given other vector.

Defined in:

VECTOR

Parameter:

#VECTOR Vec

The destination vector.

Return value:

Pathline with points on road.

Get profile of the land between the two passed points.

Defined in:

VECTOR

Parameter:

#VECTOR Vec3

The 3D destination vector. If a 2D vector is passed, y is set to the land height.

Return value:

Pathline with points of the profile.

Returns the distance from sea level at this vector.

Defined in:

VECTOR

Return value:

#number:

Distance above sea leavel in meters.

Returns the distance from sea level at this vector.

Defined in:

VECTOR

Return values:

#number:

Heigh above sea leavel in meters.

#number:

Depth (positive) at this point in meters.

Get the surface type at the vector.

  • LAND = 1
  • SHALLOW_WATER = 2
  • WATER = 3
  • ROAD = 4
  • RUNWAY = 5

Defined in:

VECTOR

Return value:

#number:

Surface type

Get the name of surface type at the vector.

  • LAND = 1
  • SHALLOW_WATER = 2
  • WATER = 3
  • ROAD = 4
  • RUNWAY = 5

Defined in:

VECTOR

Return value:

#string:

Surface type name

Returns a temperature and pressure at this vector.

Defined in:

VECTOR

Return values:

#number:

Temperatur in Kelvin.

#number:

Pressure in Pascals.

Get 2D vector as simple table.

Defined in:

VECTOR

Return value:

2D array {x, y}.

Get 3D vector as simple table.

Defined in:

VECTOR

Parameter:

#boolean OnSurface

If true, the y component is set the land height [m] of the 2D position.

Return value:

3D array {x=x, y=y, z=z}.

Returns a velocity vector of the wind at this vector.

Turbolences can be optionally be included.

Defined in:

VECTOR

Parameter:

#boolean WithTurbulence

If true, return wind including turbulence.

Return value:

Velocity 3D vector [m/s] the wind is blowing to.

Creates an illumination bomb at the specified point.

Defined in:

VECTOR

Parameters:

#number Power

The power in Candela (cd). Should be between 1 and 1000000. Default 1000 cd.

#number Altitude

(Optional) Altitude [m] at which the illumination bomb is created.

Return value:

self

Check if a given vector has line of sight with this vector.

Defined in:

VECTOR

Parameter:

#VECTOR Vec

The other vector.

Return value:

#number:

Surface Type

Create mark on F10 map.

Defined in:

VECTOR

Parameters:

#string MarkText

Free format text that shows the marking clarification.

#number Recipient

Recipient of the mark: -1=All (default), 0=Neutral, 1=Red, 2=Blue. Can also be a GROUP object.

#boolean ReadOnly

(Optional) Mark is readonly and cannot be removed by users. Default false.

Return value:

#number:

Mark ID.

Create a new VECTOR class instance from given cartesian coordinates x, y and z, where z is optional.

Note that whether the z component is passed or nil has great impact on the interpretation of the y component. If z is not given (nil), then y is used as z (the coordinate pointing East) because we always constuct a 3D vector. If z is given (not nil), then y is used as coordinate pointing up (out of plane) as for all 3D DCS vectors.

Defined in:

VECTOR

Parameters:

#number x

Component of vector along x-axis (pointing North in both 2D and 3D).

#number y

Component of vector along y-axis (pointing East in 2D and Up in 3D).

#number z

(Optional) Component of the z-axis (pointing East in 3D).

Return value:

self

Get the directional vector that points from a given vector a to another given vector b.

The vector is c=-a+b=b-a.

Defined in:

VECTOR

Parameters:

Vector a. This can also be given as any table with x, y and z components (z optional).

Vector b. This can also be given as any table with x, y and z components (z optional).

Return value:

Directional vector from a to b.

Creates a new VECTOR instance from given the latitude and longitude in decimal degrees (DD).

Defined in:

VECTOR

Parameters:

#number Latitude

Latitude in decimal degrees.

#number Longitude

Longitude in decimal degrees.

#number Altitude

(Optional) Altitude in meters. Default is the land height at the 2D position.

Return value:

self

Creates a new VECTOR instance from given latitude and longitude in degrees, minutes and seconds (DMS).

Note that latitude and longitude are passed as strings and the characters °, ' and " are important.

Defined in:

VECTOR

Parameters:

#string Latitude

Latitude in DMS as string, e.g. "42° 24' 14.3"".

#string Longitude

Longitude in DMS as string, e.g. "42° 24' 14.3"".

#number Altitude

(Optional) Altitude in meters. Default is the land height at the coordinate.

Return value:

Create a new VECTOR class instance from polar coordinates (r, phi).

Defined in:

VECTOR

Parameters:

#number r

Distance.

#number phi

Angle in Degrees. Note that 0° corresponds to North, 90° East etc.

Return value:

self

Create a new VECTOR class instance from spherical coordinates (r, theta, phi).

Defined in:

VECTOR

Parameters:

#number r

Distance in meters with r>=0.

#number theta

Polar angle in Degrees measured from a fixed polar axis or zenith direction. This angle is in [0°, 180°].

#number phi

Azimuthal angle in Degrees. This angle is in [0°, 360°).

Return value:

self

Create a new VECTOR class instance from given 2D or 3D vector object.

Defined in:

VECTOR

Parameter:

DCS#Vec3 Vec

Vector object with x, y and optionally z components. Can be a DCS#Vec2, DCS#Vec3, COORDINATE, VECTOR object.

Return value:

self

Normalize this vector, so that has a length of 1.

Defined in:

VECTOR

Return value:

self

Replace this vector with another one.

If the given vector is 2D, we

Defined in:

VECTOR

Parameters:

#VECTOR Vector

The vector that is used to replace this vector.

#boolean Project2D

If true and the given vector is 2D, we project the updated vector to 2D (y=0). Otherwise, we leave y untouched.

Return value:

self updated

Calculate the rotation or cross product of this VECTOR with another vector.

This function works for DCS#Vec2, DCS#Vec3, VECTOR, COORDINATE objects.

Defined in:

VECTOR

Parameter:

DCS#Vec3 Vec

The other vector. Can also be a DCS#Vec2, DCS#Vec3, COORDINATE or VECTOR object.

Return value:

The cross product vector.

Rotate the VECTOR clockwise in the 2D (x,z) plane.

Defined in:

VECTOR

Parameters:

#number Angle

Rotation angle in degrees). Default 0.

#boolean Copy

Create a copy of the VECTOR so the original stays unchanged.

Return value:

The translated vector or a copy of it.

Set length/norm/magnitude of this vector.

Defined in:

VECTOR

Parameter:

#number Length

Desired length of vector.

Set x-component of vector.

The x-axis points to the North.

Defined in:

VECTOR

Parameter:

#number x

Value of x. Default 0.

Return value:

self

Set y-component of vector.

The y-axis points to the upwards and describes the altitude above mean sea level.

Defined in:

VECTOR

Parameter:

#number y

Value of y. Default land/surface height at this point.

Return value:

self

Set z-component of vector.

The z-axis points to the East.

Defined in:

VECTOR

Parameter:

#number z

Value of z. Default 0.

Return value:

self

Creates a smoke at this vector.

Defined in:

VECTOR

Parameters:

#number Color

Color of the smoke: 0=Green, 1=Red, 2=White, 3=Orange, 4=Blue. Default 0.

#number Duration

(Optional) Duration of the smoke in seconds. Default nil.

Return value:

#string:

Name of the smoke object. Can be used to stop it.

Creates a large smoke and fire effect of a specified type and density at this vector.

  • 1 = small smoke and fire
  • 2 = medium smoke and fire
  • 3 = large smoke and fire
  • 4 = huge smoke and fire
  • 5 = small smoke
  • 6 = medium smoke
  • 7 = large smoke
  • 8 = huge smoke

Defined in:

VECTOR

Parameters:

#number Preset

Preset of smoke. Default BIGSMOKEPRESET.LargeSmokeAndFire.

#number Density

Density between [0,1]. Default 0.5.

#number Duration

(Optional) Duration of the smoke and fire in seconds.

Return value:

#string:

Name of the smoke. Can be used to stop it.

Stop smoke or fire effect.

Defined in:

VECTOR

Parameters:

#string Name

Name of the smoke object.

#number Delay

Delay in seconds before the smoke is stopped.

Return value:

self

Subtract a vector from this one.

This function works for DCS#Vec2, DCS#Vec3, VECTOR, COORDINATE objects.

Note that if you want to add a VECTOR, you can also simply use the - operator.

Defined in:

VECTOR

Parameter:

DCS#Vec3 Vec

Vector to substract. Can also be a DCS#Vec2, DCS#Vec3, COORDINATE or VECTOR object.

Return value:

self

Provides an MGRS string.

Defined in:

VECTOR

Parameter:

(Optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object.

Return value:

#string:

The MGRS text.

Translate the vector by a given distance and angle.

Defined in:

VECTOR

Parameters:

#number Distance

Distance in meters. Default 1000 meters.

#number Heading

Heading angle in degrees. Default 0° = North.

#boolean Copy

Create a copy of the VECTOR so the original stays unchanged.

Return value:

The translated vector or a copy of it.

Check if passed object is a Vector.

Defined in:

VECTOR

Parameter:

#table t

The object to be tested.

Return value:

#boolean:

Returns true if t is a #VECTOR and false otherwise.

Meta function to add vectors together.

Defined in:

VECTOR

Parameters:

Vector a.

Vector b.

Return value:

Returns a new VECTOR c with c[i]=a[i]+b[i] for i=x,y,z.

Meta function for dividing a vector by a scalar or by another vector.

Defined in:

VECTOR

Parameters:

Vector a.

Vector b. Can also be a #number.

Return value:

Returns a new VECTOR c with c[i]=a[i]/b or c[i]=a[i]/b[i] for i=x,y,z.

Meta function to check if two vectors are equal.

Defined in:

VECTOR

Parameters:

Vector a.

Vector b.

Return value:

#boolean:

If true, both vectors are equal

Meta function to multiplicate vector by another vector or a scalar.

Defined in:

VECTOR

Parameters:

Vector a. Can also be a #number.

Vector b. Can also be a #number.

Return value:

Returns a new VECTOR c with c[i]=a[i]*b[i] for i=x,y,z.

Meta function to subtract vectors.

Defined in:

VECTOR

Parameters:

Vector a.

Vector b.

Return value:

Returns a new VECTOR c with c[i]=a[i]-b[i] for i=x,y,z.

Meta function to change how vectors appear as string.

Defined in:

VECTOR

Return value:

#string:

String representation of vector.

Meta function to make vectors negative.

Defined in:

VECTOR

Parameter:

Vector v.