Idris2Doc : Geom.Vector

Geom.Vector

(source)

Definitions

solveQuadratic : Double -> Double -> Double -> Maybe (Double, Double)
  Tries to find solutions to the quadratic equation
`ax^2 + bx + c = 0`.

Totality: total
Visibility: export
record LinearTransformation : Type
  A linear transformation in a two-dimensional vector space
is a sequence of scalings and rotations.

By not using a matrix here we make sure that a transformation
is invertible, without the risk of a division by zero.
This might be a performance issue, but only if we create large
trees of wild mixtures of linear transformations. However,
in a UI we often work with sequences of the same type of
transformations such as a sequence of scalings or a sequence of
rotations. These are merged automatically in the `Semigroup`
implementation.

Totality: total
Visibility: public export
Constructor: 
LT : Scale -> Angle -> LinearTransformation

Projections:
.rotate : LinearTransformation -> Angle
.scale : LinearTransformation -> Scale

Hints:
Eq (Vector t)
Interpolation (Vector t)
Monoid LinearTransformation
Ord (Vector t)
Semigroup LinearTransformation
Show (Vector t)
.scale : LinearTransformation -> Scale
Totality: total
Visibility: public export
scale : LinearTransformation -> Scale
Totality: total
Visibility: public export
.rotate : LinearTransformation -> Angle
Totality: total
Visibility: public export
rotate : LinearTransformation -> Angle
Totality: total
Visibility: public export
Id : LinearTransformation
  The identity transformation

Totality: total
Visibility: public export
rotation : Angle -> LinearTransformation
  A clockwise rotation by the given angle.

Totality: total
Visibility: public export
scaling : Scale -> LinearTransformation
  A scaling by the given factor.

Totality: total
Visibility: public export
inverse : LinearTransformation -> LinearTransformation
  Computes the inverse of a linear transformation, so
`x <+> inverse x` corresponse to the identity (modulo rounding
errors).

Totality: total
Visibility: export
record Vector : LinearTransformation -> Type
  A two-dimensional vector.

Totality: total
Visibility: public export
Constructor: 
V : Double -> Double -> Vector t

Projections:
.x : Vector t -> Double
.y : Vector t -> Double

Hints:
Eq (Vector t)
Interpolation (Vector t)
Ord (Vector t)
Show (Vector t)
.x : Vector t -> Double
Totality: total
Visibility: public export
x : Vector t -> Double
Totality: total
Visibility: public export
.y : Vector t -> Double
Totality: total
Visibility: public export
y : Vector t -> Double
Totality: total
Visibility: public export
vzero : Vector t
  The zero vector.

Totality: total
Visibility: export
vone : Vector t
  Unity vector along the x axis

Totality: total
Visibility: export
vid : Double -> Double -> Vector Id
  Utility to help with type inference when using vectors in `Id`

Totality: total
Visibility: export
length : Vector t -> Double
  Computes the length of a vector.

Totality: total
Visibility: export
(+) : Vector t -> Vector t -> Vector t
  Vector addition.

Totality: total
Visibility: export
Fixity Declaration: infixl operator, level 8
negate : Neg ty => ty -> ty
  The underlying of unary minus. `-5` desugars to `negate (fromInteger 5)`.

Totality: total
Visibility: public export
Fixity Declaration: prefix operator, level 10
(-) : Vector t -> Vector t -> Vector t
  Vector subtraction.

Totality: total
Visibility: export
Fixity Declarations:
infixl operator, level 8
prefix operator, level 10
negate : Vector t -> Vector t
  Inverts the given vector by negating its coordinates.

Totality: total
Visibility: export
Fixity Declaration: prefix operator, level 10
scale : Double -> Vector t -> Vector t
  Multiply a vector with a scalar.

Totality: total
Visibility: export
scaleTo : Double -> Vector t -> Vector t
  Scales the vector to the given length.

Totality: total
Visibility: export
normalize : Vector t -> Vector t
  Normalize a vector to length 1.

Totality: total
Visibility: export
transform : LinearTransformation -> Vector t -> Vector t
  Apply a linear transformation to a vector

Totality: total
Visibility: export
polar : Scale -> Angle -> Vector t
  Define a vector by giving its length and its angle

Totality: total
Visibility: export
rotate : Angle -> Vector t -> Vector t
  Rotate a vector by the specified number of degrees

Totality: total
Visibility: export
angle : Vector t -> Maybe Angle
  Tries to calculate the angle of the given vector.
Fails in case this is the zero vector.

Totality: total
Visibility: export
angleOrZero : Vector t -> Angle
  Like `angle` but returns `zero` in case the vector is the empty vector.

Totality: total
Visibility: export
perpendicular : Vector t -> Vector t
  From a given vector `v` computes a vector perpendicular
to `v` so that `dot v (perpendicular v) === 0.0` (up to rounding
errors).

Totality: total
Visibility: export
dot : Vector t -> Vector t -> Double
  Computes the dot product of two vectors.

Totality: total
Visibility: export