Hyperbole

Syntax:

    Hyperbole (x,  y,  a_axis,  b_axis,  type, ModeStop, optional LineColour=GLCDForeground)

Explanation:

Draws on a GLCD an hyperbole with equation (x/(a)2-(y/(b)2=1, centered at pixel positions (x, y) with axis a and b.

The hyperbole can be aligned either along the x axis or along the y axis.

Both cases a_axis>=b:axis and a_axis<b_axis are accepted.

The hyperbole is an unbounded curve made by four branches

Drawing hyperbole on the screen can be stopped by following two different criteria: - a branch has reached a border of the display - all branches have reached the display border

For an hyperbole centered on the display these criteria are equivalent.

Input parameters:

Parameter Controls

x

X coordinates of hyperbole center (in pixel positions)

y

Y coordinates of hyperbole center (in pixel positions)

The x or y coordinates are Word value.

a_axis

The a axis of the hyperbole

b_axis

The b axis of the hyperbole

type

type=1 the hyperbole is aligned along x axis
type=2 the hyperbole is aligned along y axis

modestop

modestop=1 drawing stops when a display border is encountered by a hyperbole branch.
modestop=2 drawing stops when all the reachable display borders are encountered by all the hyperbole branches

LineColour

Color of the hyperbole

Example:

    'Example for a 240x320 pixels GLCD

    #include <glcd.h>

    Hyperbole(120, 160, 40,20, 1, 2, GLCDForeground)   ; centered, a=40, b=20, x_axis alined, stops when all branches have reached a a border
    Hyperbole(120, 160, 40,20, 1, 1, GLCDForeground)   ; centered, a=40, b=20, x_axis alined, stops when a border is reached
    Hyperbole(120, 160, 40,20, 2, 1, GLCDForeground)   ; centered, a=40, b=20, y_axis alined, stops when a border is reached,

    Hyperbole(180, 80, 40,20, 1, 1, GLCDForeground)   ; upper right, a=40, b=20, x_axis alined, stops when a border is reached,
    Hyperbole(60, 240, 40,20, 1, 2, GLCDForeground)   ; lower left, a=40, b=20, x_axis alined, stops when all branches have reached a border

    Hyperbole(180, 80, 40,20, 2, 1, GLCDForeground)   ; upper right, a=40, b=20, y_axis alined, stops when a border is reached,
    Hyperbole(60, 240, 40,20, 2, 2, GLCDForeground)   ; lower left, a=40, b=20, y_axis alined, stops when all branches have reached a border