cubicbezier-0.2.0: Efficient manipulating of 2D cubic bezier curves.

Geom2D

Description

Basic 2 dimensional geometry functions.

Synopsis

# Documentation

data Point Source

Constructors

 Point FieldspointX :: !Double pointY :: !Double

Instances

 Show Point AffineTransform Point

data Transform Source

A transformation (x, y) -> (ax + by + c, dx + ey + d)

Constructors

 Transform FieldsxformA :: !Double xformB :: !Double xformC :: !Double xformD :: !Double xformE :: !Double xformF :: !Double

Instances

 Show Transform AffineTransform Transform

data Line Source

Constructors

 Line Point Point

data Polygon Source

Constructors

 Polygon [Point]

Instances

 AffineTransform Polygon

class AffineTransform a whereSource

Methods

transform :: Transform -> a -> aSource

(\$*) :: AffineTransform a => Transform -> a -> aSource

Operator for applying a transformation.

Calculate the inverse of a transformation.

Return the parameters (a, b, c) for the normalised equation of the line: `a*x + b*y + c = 0`.

Return the the distance from a point to the line.

The lenght of the vector.

The angle of the vector, in the range `(-pi, pi]`.

The unitvector with the given angle.

The unit vector with the same direction.

Scale vector by constant.

Scale vector by reciprocal of constant.

Scale vector by constant, with the arguments swapped.

Subtract two vectors.

Dot product of two vectors.

Cross product of two vectors.

Distance between two vectors.

Interpolate between two vectors.

Create a transform that rotates by the angle of the given vector with the x-axis

Create a transform that rotates by the given angle (radians).

Rotate vector 90 degrees left.

Rotate vector 90 degrees right.

Create a transform that translates by the given vector.