postgresql-types
Safe HaskellNone
LanguageHaskell2010

PostgresqlTypes.Lseg

Synopsis

Documentation

data Lseg Source #

PostgreSQL lseg type. Line segment in 2D plane.

The line segment is defined by two endpoints, each with (x,y) coordinates. Stored as four 64-bit floating point numbers: (x1, y1, x2, y2).

PostgreSQL docs.

Constructors

Lseg 

Fields

  • Double

    X coordinate of first endpoint

  • Double

    Y coordinate of first endpoint

  • Double

    X coordinate of second endpoint

  • Double

    Y coordinate of second endpoint

Instances

Instances details
Arbitrary Lseg Source # 
Instance details

Defined in PostgresqlTypes.Lseg

Methods

arbitrary :: Gen Lseg #

shrink :: Lseg -> [Lseg] #

Eq Lseg Source # 
Instance details

Defined in PostgresqlTypes.Lseg

Methods

(==) :: Lseg -> Lseg -> Bool #

(/=) :: Lseg -> Lseg -> Bool #

Ord Lseg Source # 
Instance details

Defined in PostgresqlTypes.Lseg

Methods

compare :: Lseg -> Lseg -> Ordering #

(<) :: Lseg -> Lseg -> Bool #

(<=) :: Lseg -> Lseg -> Bool #

(>) :: Lseg -> Lseg -> Bool #

(>=) :: Lseg -> Lseg -> Bool #

max :: Lseg -> Lseg -> Lseg #

min :: Lseg -> Lseg -> Lseg #

IsString Lseg Source # 
Instance details

Defined in PostgresqlTypes.Lseg

Methods

fromString :: String -> Lseg #

Read Lseg Source # 
Instance details

Defined in PostgresqlTypes.Lseg

Show Lseg Source # 
Instance details

Defined in PostgresqlTypes.Lseg

Methods

showsPrec :: Int -> Lseg -> ShowS #

show :: Lseg -> String #

showList :: [Lseg] -> ShowS #

Hashable Lseg Source # 
Instance details

Defined in PostgresqlTypes.Lseg

Methods

hashWithSalt :: Int -> Lseg -> Int #

hash :: Lseg -> Int #

IsScalar Lseg Source # 
Instance details

Defined in PostgresqlTypes.Lseg

Accessors

toX1 :: Lseg -> Double Source #

Extract the X coordinate of the first endpoint.

toY1 :: Lseg -> Double Source #

Extract the Y coordinate of the first endpoint.

toX2 :: Lseg -> Double Source #

Extract the X coordinate of the second endpoint.

toY2 :: Lseg -> Double Source #

Extract the Y coordinate of the second endpoint.

Constructors

fromEndpoints :: Double -> Double -> Double -> Double -> Lseg Source #

Construct a PostgreSQL Lseg from endpoint coordinates.