HGamer3D-0.8.0: Toolset for the Haskell Game Programmer

Safe HaskellNone
LanguageHaskell98

HGamer3D.Data.Geometry2D

Contents

Description

Type definitions for 2D geometry

Synopsis

Geometry

data Num a => Point a Source #

A point has two coordinates an x and y one

Constructors

Point 

Fields

Instances

(Eq a, Num a) => Eq (Point a) Source # 

Methods

(==) :: Point a -> Point a -> Bool #

(/=) :: Point a -> Point a -> Bool #

(Num a, Show a) => Show (Point a) Source # 

Methods

showsPrec :: Int -> Point a -> ShowS #

show :: Point a -> String #

showList :: [Point a] -> ShowS #

ComponentClass (Point Float) Source # 
ComponentClass (Point Int) Source # 

data Num a => Rectangle a Source #

A rectangle has an a position as x and y and widht and height

Constructors

Rectangle 

Fields

rectFromPoints :: Num a => Point a -> Point a -> Rectangle a Source #

derive a rectangle from upper left and lower right points

pointsFromRect :: Num a => Rectangle a -> (Point a, Point a) Source #

get upper left and lower right point from a rect