wumpus-basic-0.14.0: Common drawing utilities built on wumpus-core.

PortabilityGHC
Stabilityhighly unstable
MaintainerStephen Tetley <stephen.tetley@gmail.com>

Wumpus.Drawing.Paths.ControlPoints

Description

Collection of point manufacturing functions.

** WARNING ** this module is experimental and may change significantly in future revisions.

Synopsis

Documentation

midpointIsosceles :: (Real u, Floating u) => u -> Point2 u -> Point2 u -> Point2 uSource

midpointIsosceles : altitude * start_pt * end_pt -> mid_pt

Triangular midpoint.

u is the altitude of the triangle - negative values of u form the triangle below the line.

dblpointIsosceles :: (Real u, Floating u) => u -> Point2 u -> Point2 u -> (Point2 u, Point2 u)Source

dblpointIsosceles : altitude * start_pt * end_pt * (third_pt, two_thirds_pt)

Double triangular joint - one joint at a third of the line length, the other at two thirds.

rectangleFromBasePoints :: (Real u, Floating u) => u -> Point2 u -> Point2 u -> (Point2 u, Point2 u)Source

rectangleFromBasePoints : altitude * start_pt * end_pt * (top_left, top_right)

Control points forming a rectangle.

The two manufactured control points form the top corners, so the supplied points map as start_point == bottom_left and end_point == bottom_right.

squareFromBasePoints :: (Real u, Floating u) => Point2 u -> Point2 u -> (Point2 u, Point2 u)Source

squareFromBasePoints : start_pt -> end_pt -> (top_left, top_right)

Control points forming a square - side_len derived from the distance between start and end points.

The two manufactured control points form the top corners, so the supplied points map as start_point == bottom_left and end_point == bottom_right.

usquareFromBasePoints :: (Real u, Floating u) => Point2 u -> Point2 u -> (Point2 u, Point2 u)Source

usquareFromBasePoints : start_pt -> end_pt -> (bottom_left, bottom_right)

Control points forming a square - side_len derived from the distance between start and end points.

As per squareFromBasePoints but the square is drawn underneath the line formed between the start and end points. (Underneath is modulo the direction, of course).

The two manufactured control points form the bottom corners, so the supplied points map as start_point == top_left and end_point == top_right.

trapezoidFromBasePoints :: (Real u, Floating u) => u -> u -> Point2 u -> Point2 u -> (Point2 u, Point2 u)Source

trapezoidFromBasePoints : altitude * ratio_to_base * start_pt * end_pt -> (top_left, top_right)

Control points form an isosceles trapezoid.

The two manufactured control points form the top corners, so the supplied points map as start_point == bottom_left and end_point == bottom_right.

squareFromCornerPoints :: (Real u, Floating u) => Point2 u -> Point2 u -> (Point2 u, Point2 u)Source

squareFromCornerPoints : altitude * start_pt * end_pt * (top_left, bottom_right)

Control points forming a square bisected by the line from start_pt to end_pt.

The two manufactured control points form the top_left and bottom_right corners, so the supplied points map as start_point == bottom_left and end_point == top_right.