Skip to content

Commit

Permalink
feature(Coordinates): add toArray method.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoqueux authored and jailln committed Oct 30, 2023
1 parent db3e455 commit ebadc9c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Core/Geographic/Coordinates.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,20 @@ class Coordinates {
return target.copy(this);
}

/**
* Copy values coordinates to array
*
* @param {number[]} array - array to store this vector to. If this is not
* provided a new array will be created.
* @param {number} [offset=0] - optional offset into the array.
*
* @return {number[]} Returns an array [x, y, z], or copies x, y and z into
* the provided array.
*/
toArray(array = [], offset = 0) {
return THREE.Vector3.prototype.toArray.call(this, array, offset);
}

/**
* Calculate planar distance between this coordinates and `coord`.
* Planar distance is the straight-line euclidean distance calculated in a 2D cartesian coordinate system.
Expand Down

0 comments on commit ebadc9c

Please sign in to comment.