gloss-accelerate-2.1.0.0: Extras to interface Gloss and Accelerate

Copyright[2013..2020] Trevor L. McDonell
LicenseBSD3
MaintainerTrevor L. McDonell <trevor.mcdonell@gmail.com>
Stabilityexperimental
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Graphics.Gloss.Accelerate.Data.Point

Contents

Description

 
Synopsis

Point data type

type Point = V2 Float Source #

An abstract point value on the xy-plane.

Point creation

makePoint Source #

Arguments

:: Exp Float

x-coordinate

-> Exp Float

y-coordinate

-> Exp Point 

Make a custom point

xyOfPoint :: Exp Point -> (Exp Float, Exp Float) Source #

Take the components of a point

pointOfIndex Source #

Arguments

:: Int

width

-> Int

height

-> Exp DIM2 
-> Exp Point 

Convert a two-dimensional index into a point centered in a plane of the given width and height.

Testing points

pointInBox Source #

Arguments

:: Exp Point

point to test

-> Exp Point

corner of box

-> Exp Point

opposite corner of box

-> Exp Bool 

Test whether a point lies within a rectangular box that is oriented on the x-y plane. The points P1-P2 are opposing points of the box, but need not be in a particular order.

   P2 +-------+
      |       |
      | + P0  |
      |       |
      +-------+ P1