# Vector3

From Wake

**Class:** Vector3

**Type:** native

**Can Construct:** yes

## Description

Provides a Vector3 class and mathematical functions.

## Conversions

Almost all Vector3 functions accept either an instance of a Vector3 or a table of length 3 as shorthand.

## Functions

Description | |
---|---|

Vector3.new | Constructor. |

Vector3:apply | Create a new vector by applying a function to each element of the current vector. |

Vector3:cross | Calculate the cross product between two vectors. |

Vector3:distance | Calculate the distance between two vectors. |

Vector3:dot | Calculate the dot product between two vectors. |

Vector3:get | Get an element from a vector. |

Vector3:length | Calculate the length of a vector. |

Vector3:normalize | Calculate the normalized form of a vector. |

Vector3:reflect | Calculate the reflection direction. |

Vector3:refract | Calculate the refraction vector. |

Vector3:set | Set the value of an element in a vector. |

Vector3:setAll | Set all values contained in a vector. |

Vector3:table | Get the table representation of a vector. |