doodle.geom.createPoint
Description:
- Point (x:number, y:number) :Point
-
Inherits
- Object
Parameters
- x:number – [optional]
- y:number – [optional]
Returns
- Point –
Throws
- TypeError –
- SyntaxError –
Properties
- x :number
-
The horizontal coordinate of the point.
Returns
- number –
Throws
- TypeError –
- length :number
-
The length of the line segment from (0,0) to this point.
Returns
- number –
- y :number
-
The vertical coordinate of the point.
Returns
- number –
Throws
- TypeError –
Methods
- add (pt:Point) :Point
-
Adds the coordinates of another point to the coordinates of this point to create a new point.
Parameters
- pt:Point – The point to be added.
Returns
- Point – The new point.
Throws
- TypeError –
- polar (len:number, angle:number) :Point
-
Converts a pair of polar coordinates to a Cartesian point coordinate.
Parameters
- len:number – The length coordinate of the polar pair.
- angle:number – The angle, in radians, of the polar pair.
Returns
- Point –
Throws
- TypeError –
- clone () :Point
-
Creates a copy of this Point object.
Returns
- Point –
- interpolate (pt1:Point, pt2:Point, t:number) :Point
-
Determines a point between two specified points.
Parameters
- pt1:Point – The first point.
- pt2:Point – The second point.
- t:number – The level of interpolation between the two points, between 0 and 1.
Returns
- Point –
Throws
- TypeError –
- equals (pt:Point) :boolean
-
Determines whether two points are equal.
Parameters
- pt:Point – The point to be compared.
Returns
- boolean –
Throws
- TypeError –
- id () :string
-
Returns
- string –
- offset (dx:number, dy:number) :void
-
Parameters
- dx:number –
- dy:number –
Throws
- TypeError –
- toArray () :Array
-
Returns an array that contains the values of the x and y coordinates.
Returns
- Array –
- toString () :string
-
Returns a string that contains the values of the x and y coordinates.
Returns
- string –
- normalize (thickness:number) :Point
-
Scales the line segment between (0,0) and the current point to a set length.
Parameters
- thickness:number – The scaling value.
Returns
- Point –
Throws
- TypeError –
- compose (x:number, y:number) :Point
-
Set point coordinates.
Parameters
- x:number –
- y:number –
Returns
- Point –
Throws
- TypeError –
- subtract (pt:Point) :Point
-
Subtracts the coordinates of another point from the coordinates of this point to create a new point.
Parameters
- pt:Point – The point to be subtracted.
Returns
- Point – The new point.
Throws
- TypeError –
Class Functions
- isPoint (pt:Point) :boolean
-
Check if a given object contains a numeric x and y property. Does not check if a point is actually a doodle.geom.point.
Parameters
- pt:Point –
Returns
- boolean –
- distance (pt1:Point, pt2:Point) :number
-
Returns the distance between pt1 and pt2.
Parameters
- pt1:Point –
- pt2:Point –
Returns
- number –
Throws
- TypeError –