package toffee
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9e4e90d17f9b2af1b07071fe425bc2c519c849c4f1d1ab73cde512be2d874849
sha512=06e9c4a741590942e81a27738d0b5c0413fafec8cf3b7dae047ad69f155e7b718aa4223818dc161b7d028efffcfd3365905e264d6fd31d453910ddfa91dcf9b9
doc/toffee.geometry/Geometry/Point/index.html
Module Geometry.PointSource
2-dimensional point representation.
'a t represents a 2-dimensional point with x and y coordinates.
Constants
Creation
Arithmetic operations
sub a b subtracts corresponding coordinates of b from a.
mul_scalar point scalar multiplies both components of point by scalar.
div_scalar point scalar divides both components of point by scalar.
Mapping
map2 f p1 p2 applies f to corresponding coordinates of p1 and p2.
Axis accessors
get axis point retrieves the component corresponding to axis.
set axis value point returns a new point with the component corresponding to axis set to value.
Transformations
Conversions
to_size point converts a point to a size by mapping x -> width and y -> height.
of_size size converts a size to a point by mapping width -> x and height -> y.
Comparison and string functions
compare cmp a b compares a and b lexicographically using cmp.
equal eq a b tests equality using eq for each coordinate.
to_string f point converts point to a string using f.
pp f fmt point prints point using fmt and f.