{"size": 2038, "ext": "js", "max_stars_repo_path": "dist/skylark-jsmodeler/geometry/coord2d.js", "max_stars_repo_name": "skylark-integration/skylark-jsmodeler", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "dist/skylark-jsmodeler/geometry/coord2d.js", "max_issues_repo_name": "skylark-integration/skylark-jsmodeler", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "dist/skylark-jsmodeler/geometry/coord2d.js", "max_forks_repo_name": "skylark-integration/skylark-jsmodeler", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 203.8, "max_line_length": 1759, "alphanum_fraction": 0.7281648675}
/**
 * skylark-jsmodeler - A version of jsmodeler that ported to running on skylarkjs
 * @author Hudaokeji, Inc.
 * @version v0.9.0
 * @link https://github.com/skylark-integration/skylark-jsmodeler/
 * @license MIT
 */
define(["../core/jsm"],function(t){return t.Coord2D=function(t,o){this.x=t,this.y=o},t.Coord2D.prototype.Set=function(t,o){this.x=t,this.y=o},t.Coord2D.prototype.IsEqual=function(o){return t.IsEqual(this.x,o.x)&&t.IsEqual(this.y,o.y)},t.Coord2D.prototype.IsEqualWithEps=function(o,r){return t.IsEqualWithEps(this.x,o.x,r)&&t.IsEqualWithEps(this.y,o.y,r)},t.Coord2D.prototype.DistanceTo=function(t){return Math.sqrt((t.x-this.x)*(t.x-this.x)+(t.y-this.y)*(t.y-this.y))},t.Coord2D.prototype.AngleTo=function(o){var r=this.Clone().Normalize(),i=o.Clone().Normalize();if(r.IsEqual(i))return 0;var n=t.VectorDot2D(r,i);return t.ArcCos(n)},t.Coord2D.prototype.Length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.Coord2D.prototype.MultiplyScalar=function(t){return this.x*=t,this.y*=t,this},t.Coord2D.prototype.Normalize=function(){var o=this.Length();return t.IsPositive(o)&&this.MultiplyScalar(1/o),this},t.Coord2D.prototype.SetLength=function(o){var r=this.Length();return t.IsPositive(r)&&this.MultiplyScalar(o/r),this},t.Coord2D.prototype.Offset=function(t,o){var r=t.Clone().Normalize();return this.x+=r.x*o,this.y+=r.y*o,this},t.Coord2D.prototype.Rotate=function(t,o){var r=this.x-o.x,i=this.y-o.y,n=Math.cos(t),e=Math.sin(t);return this.x=r*n-i*e+o.x,this.y=r*e+i*n+o.y,this},t.Coord2D.prototype.ToString=function(){return"("+this.x+", "+this.y+")"},t.Coord2D.prototype.Clone=function(){return new t.Coord2D(this.x,this.y)},t.Vector2D=t.Coord2D,t.CoordFromArray2D=function(o){return new t.Coord2D(o[0],o[1])},t.CoordToArray2D=function(t){return[t.x,t.y]},t.CoordAdd2D=function(o,r){return new t.Coord2D(o.x+r.x,o.y+r.y)},t.CoordSub2D=function(o,r){return new t.Coord2D(o.x-r.x,o.y-r.y)},t.VectorDot2D=function(t,o){return t.x*o.x+t.y*o.y},t});
//# sourceMappingURL=../sourcemaps/geometry/coord2d.js.map
