# Vector Mathematics

## Functions

Lib3dsBool | lib3ds_vector_read (Lib3dsVector v, FILE *f)
Lib3dsBool | lib3ds_vector_write (Lib3dsVector v, FILE *f)
void | lib3ds_vector_zero (Lib3dsVector c)
void | lib3ds_vector_copy (Lib3dsVector dest, Lib3dsVector src)
void | lib3ds_vector_neg (Lib3dsVector c)
void | lib3ds_vector_add (Lib3dsVector c, Lib3dsVector a, Lib3dsVector b)
void | lib3ds_vector_sub (Lib3dsVector c, Lib3dsVector a, Lib3dsVector b)
void | lib3ds_vector_scalar (Lib3dsVector c, Lib3dsFloat k)
void | lib3ds_vector_cross (Lib3dsVector c, Lib3dsVector a, Lib3dsVector b)
Lib3dsFloat | lib3ds_vector_dot (Lib3dsVector a, Lib3dsVector b)
Lib3dsFloat | lib3ds_vector_squared (Lib3dsVector c)
Lib3dsFloat | lib3ds_vector_length (Lib3dsVector c)
void | lib3ds_vector_normalize (Lib3dsVector c)
void | lib3ds_vector_normal (Lib3dsVector n, Lib3dsVector a, Lib3dsVector b, Lib3dsVector c)
void | lib3ds_vector_transform (Lib3dsVector c, Lib3dsMatrix m, Lib3dsVector a)
void | lib3ds_vector_cubic (Lib3dsVector c, Lib3dsVector a, Lib3dsVector p, Lib3dsVector q, Lib3dsVector b, Lib3dsFloat t)
void | lib3ds_vector_min (Lib3dsVector c, Lib3dsVector a)
void | lib3ds_vector_max (Lib3dsVector c, Lib3dsVector a)
void | lib3ds_vector_dump (Lib3dsVector c)

## Detailed Description

Author:
  J.E. Hoffmann <je-h@gmx.net>

## Function Documentation

void lib3ds_vector_add | ( | Lib3dsVector | c,
|  | Lib3dsVector | a,
|  | Lib3dsVector | b
| ) |

void lib3ds_vector_copy | ( | Lib3dsVector | dest,
|  | Lib3dsVector | src
| ) |

void lib3ds_vector_cross | ( | Lib3dsVector | c,
|  | Lib3dsVector | a,
|  | Lib3dsVector | b
| ) |

void lib3ds_vector_cubic | ( | Lib3dsVector | c,
|  | Lib3dsVector | a,
|  | Lib3dsVector | p,
|  | Lib3dsVector | q,
|  | Lib3dsVector | b,
|  | Lib3dsFloat | t
| ) |

Lib3dsFloat lib3ds_vector_dot | ( | Lib3dsVector | a,
|  | Lib3dsVector | b
| ) |

void lib3ds_vector_dump | ( | Lib3dsVector | c | ) |

Lib3dsFloat lib3ds_vector_length | ( | Lib3dsVector | c | ) |

void lib3ds_vector_max | ( | Lib3dsVector | c,
|  | Lib3dsVector | a
| ) |

| c[i] = max(c[i], a[i]);

void lib3ds_vector_min | ( | Lib3dsVector | c,
|  | Lib3dsVector | a
| ) |

| c[i] = min(c[i], a[i]);

void lib3ds_vector_neg | ( | Lib3dsVector | c | ) |

void lib3ds_vector_normal | ( | Lib3dsVector | n,
|  | Lib3dsVector | a,
|  | Lib3dsVector | b,
|  | Lib3dsVector | c
| ) |

void lib3ds_vector_normalize | ( | Lib3dsVector | c | ) |

Lib3dsBool lib3ds_vector_read | ( | Lib3dsVector | v,
|  | FILE * | f
| ) |

Read a vector from a file stream in little endian format.

Parameters:

  | v | The vector to store the data.
  | f | Input file stream.

Returns:
  The float read.

void lib3ds_vector_scalar | ( | Lib3dsVector | c,
|  | Lib3dsFloat | k
| ) |

Lib3dsFloat lib3ds_vector_squared | ( | Lib3dsVector | c | ) |

void lib3ds_vector_sub | ( | Lib3dsVector | c,
|  | Lib3dsVector | a,
|  | Lib3dsVector | b
| ) |

void lib3ds_vector_transform | ( | Lib3dsVector | c,
|  | Lib3dsMatrix | m,
|  | Lib3dsVector | a
| ) |

Lib3dsBool lib3ds_vector_write | ( | Lib3dsVector | v,
|  | FILE * | f
| ) |

Writes a vector into a file stream in little endian format.

Parameters:

  | v | The vector to write to the file stream.
  | f | Input file stream.

void lib3ds_vector_zero | ( | Lib3dsVector | c | ) |