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/Triangle/index.html

Module TriangleSource

Triangles manipulation

Sourcetype t = private Point.t * Point.t * Point.t

the type of triangles

Sourceval tri_map : (Point.t -> Point.t) -> t -> t

tri_map f t applies function f in turn to all the points of t and stores the results in a new triangle that is returned.

Sourceval tri_exists : (Point.t -> bool) -> t -> bool

Higher order utilities over the triangles

Sourceval tri_find : (Point.t -> bool) -> t -> Point.t
Sourceval tri_forall : (Point.t -> bool) -> t -> bool
Sourceval tri_iter : (Point.t -> unit) -> t -> unit
Sourceval transform : t -> Affine.t -> t

affine transformation of a triangle

Sourceval make : Point.t -> Point.t -> Point.t -> t

builds a triangle from three different points. raises Invalid_arg if at least two points are equal

Sourceval extr1 : t -> Point.t

returns a vertice of the triangle. The vertice returned is different than the one returned by extr2 and extr3.

Sourceval extr2 : t -> Point.t

returns a vertice of the triangle. The vertice returned is different than the one returned by extr1 and extr3.

Sourceval extr3 : t -> Point.t

returns a vertice of the triangle. The vertice returned is different than the one returned by extr1 and extr2.

Sourceval scale_x : t -> float -> t
Sourceval scale_y : t -> float -> t
Sourceval translate : float -> float -> t -> t
Sourceval reflection : Point.t -> t -> t
Sourceval contains : t -> Point.t -> bool

tests if a point is in a triangle

Sourceval rotate : t -> Point.t -> float -> t

rotation, angle in radian

Sourceval rotate_angle : t -> Point.t -> float -> t

rotation, angle in degree

Sourceval area : t -> float
Sourceval perimeter : t -> float
Sourceval proj_x : t -> float * float
Sourceval proj_y : t -> float * float
Sourceval segments : t -> Segment.t * Segment.t * Segment.t
Sourceval intersects : t -> t -> bool
Sourceval intersect_line : t -> Line.t -> Point.t list
Sourceval is_isoscele : t -> bool
Sourceval is_equilateral : t -> bool
Sourceval is_right : t -> bool
Sourceval points : t -> Point.t * Point.t * Point.t
Sourceval of_points : (Point.t * Point.t * Point.t) -> t
Sourceval angles : t -> float * float * float
Sourceval centroid : t -> Point.t

returns the gravity center of a triangle

Sourceval random_point : Random.State.t -> t -> Point.t

returns a randomly and uniformly chosen point of the triangle

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

printer

OCaml

Innovation. Community. Security.