haha-0.1: A simple library for creating animated ascii art on ANSI terminals.

Geometry

Documentation

data Point u Source

Constructors

Point 

Fields

_x :: u
 
_y :: u
 

Instances

Geometry Point 
Eq u => Eq (Point u) 
Ord u => Ord (Point u) 
Show u => Show (Point u) 

data Line u Source

Constructors

Line 

Fields

_a :: Point u
 
_b :: Point u
 

Instances

Geometry Line 
Eq u => Eq (Line u) 
Ord u => Ord (Line u) 
Show u => Show (Line u) 

data Tri u Source

Constructors

Tri (Point u) (Point u) (Point u) 

Instances

Geometry Tri 
Eq u => Eq (Tri u) 
Ord u => Ord (Tri u) 
Show u => Show (Tri u) 

data Poly u Source

Constructors

Poly [Point u] 

Instances

Geometry Poly 
Eq u => Eq (Poly u) 
Ord u => Ord (Poly u) 
Show u => Show (Poly u) 

data Mesh u Source

Constructors

Mesh [Tri u] 

Instances

Eq u => Eq (Mesh u) 
Ord u => Ord (Mesh u) 
Show u => Show (Mesh u) 

data Rect u Source

Constructors

Rect (Point u) (Point u) 

Instances

Eq u => Eq (Rect u) 
Ord u => Ord (Rect u) 
Show u => Show (Rect u) 

data Circle u Source

Constructors

Circle (Point u) u 

Instances

Eq u => Eq (Circle u) 
Ord u => Ord (Circle u) 
Show u => Show (Circle u) 

data Elipse u Source

Constructors

Elipse (Point u) u u 

Instances

Eq u => Eq (Elipse u) 
Ord u => Ord (Elipse u) 
Show u => Show (Elipse u) 

class Geometry g whereSource

Methods

centroid :: (Ord u, Floating u) => g u -> Point uSource

bounds :: (Ord u, Floating u) => g u -> Rect uSource

translate :: (Ord u, Floating u) => u -> u -> g u -> g uSource

rotate :: (Ord u, Floating u) => u -> Point u -> g u -> g uSource

scale :: (Ord u, Floating u) => u -> Point u -> g u -> g uSource

outline :: g u -> Poly uSource

mesh :: g u -> Mesh uSource

discrete :: (RealFrac u, Integral i) => g u -> g iSource

rotateLocal :: (Geometry g, Ord u, Floating u) => u -> g u -> g uSource

translatePoint :: Num u => u -> u -> Point u -> Point uSource

rotatePoint :: Floating u => u -> Point u -> Point u -> Point uSource

scalePoint :: Num u => u -> Point u -> Point u -> Point uSource

translateLine :: (Ord u, Floating u) => u -> u -> Line u -> Line uSource

rotateLine :: (Ord u, Floating u) => u -> Point u -> Line u -> Line uSource

scaleLine :: (Ord u, Floating u) => u -> Point u -> Line u -> Line uSource

centroidTri :: (Ord u, Floating u) => Tri u -> Point uSource

boundsTri :: Ord u => Tri u -> Rect uSource

translateTri :: (Ord u, Floating u) => u -> u -> Tri u -> Tri uSource

rotateTri :: (Ord u, Floating u) => u -> Point u -> Tri u -> Tri uSource

scaleTri :: (Ord u, Floating u) => u -> Point u -> Tri u -> Tri uSource

boundsPoly :: Ord u => Poly u -> Rect uSource

translatePoly :: (Ord u, Floating u) => u -> u -> Poly u -> Poly uSource

rotatePoly :: (Ord u, Floating u) => u -> Point u -> Poly u -> Poly uSource

scalePoly :: (Ord u, Floating u) => u -> Point u -> Poly u -> Poly uSource

inRect :: Ord u => Point u -> Rect u -> BoolSource

intersectRect :: (Ord u, Num u) => Rect u -> Rect u -> Maybe (Rect u)Source

star :: (Enum u, Floating u) => Point u -> u -> u -> u -> Poly uSource