GeoGen Script reference
Contructors | Properties
Point Class Reference

Point in two-dimensional space. More...

Contructors

static Point Create (Coordinate x, Coordinate y)
 Creates a point from a pair of coordinates. More...
 

Properties

Number X [get]
 Gets the X component of the point's coordinates. More...
 
Number Y [get]
 Gets the Y component of the point's coordinates. More...
 

Detailed Description

Point in two-dimensional space.

A point is composed from two Coordinates. These coordinates can be independently either absolute or relative. The @ operator can be used on a point to make both of the contained coordinates relative:

Example:

// Assumes max with size 2000x1000.
HeightMap.Gradient([500,500], 250, 1, 0); // Creates a gradient centered at point 500, 500.
HeightMap.Gradient(@[0.25, 0.50], 250, 1, 0); // The same.
HeightMap.Gradient([500, @0.50], 250, 1, 0); // Still the same.

The Point object is immutable, the X and Y accessors can only read the component coordinates.

Member Function Documentation

static Point Point.Create ( Coordinate  x,
Coordinate  y 
)
static

Creates a point from a pair of coordinates.

Parameters
xThe X coordinate.
yThe Y coordinate.
Returns
The point.

Property Documentation

Number Point.X
get

Gets the X component of the point's coordinates.

Returns
The X coordinate.
Number Point.Y
get

Gets the Y component of the point's coordinates.

Returns
The Y coordinate.