package geoml

  1. Overview
  2. Docs
Geoml: 2D Geometry library for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

0.1.1.tar.gz
md5=37ca15d64a035762d12c4bd7064a1841
sha512=109d7597bd2a8d6628b4c0ee40cd94066fe09ce565bb35fe10683e5f701c1d058daaec79702b4f5f8ed68eeed444c363ca6070f854bbdfb6d0cd997db0f21408

doc/geoml/Vector/index.html

Module VectorSource

Sourcetype t = private {
  1. dx : float;
  2. dy : float;
}

The module for the euclidean vector manipulation.

Sourceval make : float -> float -> t
Sourceval null : t

null vector

Sourceval x_coord : t -> float
Sourceval y_coord : t -> float
Sourceval of_points : Point.t -> Point.t -> t

of_points a b returns the vector begining at a and landing at b

Sourceval magnitude : t -> float

returns the norm of a vector

Sourceval magnitude_sq : t -> float

returns the square of the norm of a vector

Sourceval normalize : t -> t

return a vector with same direction but with a norm equal to 1.

Sourceval rotation : float -> t -> t
Sourceval dot_product : t -> t -> float

dot product of two vectors

Sourceval scal_mult : float -> t -> t

scalar product of two vectors

Sourceval determinant : t -> t -> float
Sourceval opposite : t -> t
Sourceval add : t -> t -> t

vector addition

Sourceval substract : t -> t -> t

vector substraction

Sourceval move_to : t -> Point.t -> Point.t

move_to v p returns the translation of p according to the vector v

Sourceval projection : t -> t -> t

projection v1 v2 returns the projection of v1 on v2

Sourceval angle : t -> t -> float

returns the angle between two vectors

Sourceval angle_deg : t -> t -> float

compute the angle in radians

compute the angle in degrees

Sourceval reflect : t -> t -> t

reflect a b returns the reflected vector of a according to b

Sourceval print : Format.formatter -> t -> unit
OCaml

Innovation. Community. Security.