/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../core/arrayUtils","../../core/ObjectStack","../../chunks/vec3","../../chunks/vec3f64","./vectorStacks"],(function(n,i,t,r,e,o){"use strict";function c(n){return n?{origin:e.clone(n.origin),direction:e.clone(n.direction)}:{origin:e.create(),direction:e.create()}}function u(n,t){return i.equals(n.origin,t.origin)&&i.equals(n.direction,t.direction)}function s(n,i){const t=p.get();return t.origin=n,t.direction=i,t}function d(n,i=c()){return g(n.origin,n.direction,i)}function a(n,i,t=c()){return r.copy(t.origin,n),r.subtract(t.direction,i,n),t}function g(n,i,t=c()){return r.copy(t.origin,n),r.copy(t.direction,i),t}function l(n,i){const t=r.cross(o.sv3d.get(),r.normalize(o.sv3d.get(),n.direction),r.subtract(o.sv3d.get(),i,n.origin));return r.dot(t,t)}function f(n,i){return Math.sqrt(l(n,i))}function v(n,i,t){const e=r.dot(n.direction,r.subtract(t,i,n.origin));return r.add(t,n.origin,r.scale(t,n.direction,e)),t}function b(){return{origin:null,direction:null}}const p=new t.ObjectStack(b);n.closestPoint=v,n.copy=d,n.create=c,n.distance=f,n.distance2=l,n.equals=u,n.fromPoints=a,n.fromValues=g,n.wrap=s,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
