How to use the @swim/math.PointR2.origin function in @swim/math

To help you get started, we’ve selected a few @swim/math examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github swimos / swim / swim-system-js / swim-ux-js / @swim / map / main / MapPolygonView.ts View on Github external
appendCoord(coord: AnyLngLat): void {
    coord = LngLat.fromAny(coord);
    this._coords.push(new AnyMemberAnimator(LngLat, this, coord as LngLat));
    this._points.push(PointR2.origin());
    this.requireUpdate(View.NeedsAnimate | MapView.NeedsProject);
  }
github swimos / swim / swim-system-js / swim-ui-js / @swim / view / main / GraphicViewController.ts View on Github external
get anchor(): PointR2 {
    const view = this._view;
    return view ? view.anchor : PointR2.origin();
  }
github swimos / swim / swim-system-js / swim-ux-js / @swim / map / main / MapPolygonView.ts View on Github external
setCoords(coords: AnyLngLat[], tween?: Tween): void {
    let i = 0;
    for (const n = Math.min(this._coords.length, coords.length); i < n; i += 1) {
      const coord = LngLat.fromAny(coords[i]);
      this._coords[i].setState(coord, tween);
    }
    for (const n = coords.length; i < n; i += 1) {
      const coord = LngLat.fromAny(coords[i]);
      this._coords.push(new AnyMemberAnimator(LngLat, this, coord as LngLat));
      this._points.push(PointR2.origin());
      this.requireUpdate(View.NeedsAnimate | MapView.NeedsProject);
    }
    this._coords.length = coords.length;
  }
github swimos / swim / swim-system-js / swim-ux-js / @swim / map / main / MapPolygonView.ts View on Github external
insertCoord(index: number, coord: AnyLngLat): void {
    coord = LngLat.fromAny(coord);
    this._coords.splice(index, 0, new AnyMemberAnimator(LngLat, this, coord as LngLat));
    this._points.splice(index, 0, PointR2.origin());
    this.requireUpdate(View.NeedsAnimate | MapView.NeedsProject);
  }
github swimos / swim / swim-system-js / swim-ui-js / @swim / view / main / CanvasViewController.ts View on Github external
get anchor(): PointR2 {
    const view = this._view;
    return view ? view.anchor : PointR2.origin();
  }

@swim/math

Mathematical and geometric structures and operators

Apache-2.0
Latest version published 2 months ago

Package Health Score

72 / 100
Full package analysis

Similar packages