Powered by Zoomin Software. For more details please contactZoomin

HERE Maps API for JavaScript - API Reference

Product category
Technology
Doc type
Version
Product lifecycle
This publication

HERE Maps API for JavaScript - API Reference: Class: Point

Table of Contents

Class: Point

H.math.Point

new H.math.Point (x, y)

This class represents a two-dimensional point, defined by its x and y coordinates.

Name Type Description
x number

coordinate of the point

y number

coordinate of the point

Implements

Members

x number

This property represents the x-coordinate of the point.

y number

This property represents the y-coordinate of the point.

Methods

H.math.Point.fromIPoint (iPoint)H.math.Point static

This method creates a Point instance from the IPoint object provided by the caller.

Name Type Description
iPoint H.math.IPoint

An object implementing IPoint

Returns:
Type Description
H.math.Point An object representing the newly created Point instance

add (other)H.math.Point

This method adds the coordinates of the point supplied by the caller to the coordinates of the given point.

Name Type Description
other H.math.IPoint

An object whose coordinates are to be added to those of the given point

Returns:
Type Description
H.math.Point An object representing the given point after its coordinates have been modified

ceil ()H.math.Point

This method rounds the x and y coordinates of the given point up to the next greater integer values.

Returns:
Type Description
H.math.Point An object representing the given point after its coordinates have been rounded up to the nearest integer

clone (opt_out)H.math.Point

This method this creates a copy of the current point.

Name Type Description
opt_out H.math.Point optional

An optional point object to store the copied values

Returns:
Type Description
H.math.Point An object representing a clone of the given point

distance (other)number

This method calculates the distance to a point supplied by the caller.

Name Type Description
other H.math.IPoint

An object representing the point to which the distance is to be calculated

Returns:
Type Description
number A value indicating the distance to the point supplied by the caller

equals (other)boolean

This method compares two points by checking if their coordinates are equal.

Name Type Description
other H.math.IPoint

An object representing the point to which to compare the given point

Returns:
Type Description
boolean true if the points are equal, otherwise false

floor ()H.math.Point

This method rounds the x and y coordinates of the given point down to the next smaller integer values.

Returns:
Type Description
H.math.Point An object representing the given point after its coordinates have been rounded down to the nearest integer

getNearest (start, end)H.math.IPoint

This method calculates the closest point on the line specified by the caller to the given point.

Name Type Description
start H.math.IPoint

A an object representing the start point of the line

end H.math.IPoint

A an object representing the end point of the line

Returns:
Type Description
H.math.IPoint An object representing the closest point on the line to the given point

round ()H.math.Point

This method rounds the x and y coordinates of the given point.

Returns:
Type Description
H.math.Point An object representing the given point after its coordinates have been rounded

scale (factor, opt_factorY)H.math.Point

This method scales the coordinates of the given point by the factor(s) provided by the caller.

Name Type Description
factor number

A value indicating the multiplication factor

opt_factorY number optional

An optional value indicating the multiplication factor for the y-coordinate; if omitted, only factor is used

Returns:
Type Description
H.math.Point An object representing the given point after its coordinates have been scaled

set (x, y)

This method sets the x and y coordinate of the point.

Name Type Description
x number

A value indicating the x-coordinate

y number

A value indicating the y-coordinate

sub (other)H.math.Point

This method subtract the coordinates of the point supplied by the caller from the coordinates from the given point.

Name Type Description
other H.math.IPoint

An object representing the point whose coordinates are to be subtracted from those of the given point

Returns:
Type Description
H.math.Point An object representing the given point after its coordinates have been modified
Was this article helpful?
TitleResults for “How to create a CRG?”Also Available inAlert