How to use the @here/harp-geoutils.sphereProjection.reprojectPoint function in @here/harp-geoutils

To help you get started, we’ve selected a few @here/harp-geoutils 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 heremaps / harp.gl / @here / harp-geometry / lib / SphericalGeometrySubdivisionModifier.ts View on Github external
protected shouldSplitTriangle(a: Vector3, b: Vector3, c: Vector3): number | undefined {
        const aa = sphereProjection.reprojectPoint(this.projection, a, VERTEX_POSITION_CACHE[0]);
        const bb = sphereProjection.reprojectPoint(this.projection, b, VERTEX_POSITION_CACHE[1]);
        const cc = sphereProjection.reprojectPoint(this.projection, c, VERTEX_POSITION_CACHE[2]);

        const alpha = aa.angleTo(bb);
        const beta = bb.angleTo(cc);
        const gamma = cc.angleTo(aa);

        // find the maximum angle
        const m = Math.max(alpha, Math.max(beta, gamma));

        // split the triangle if needed.
        if (m < this.angle) {
            return undefined;
        }

        if (m === alpha) {
            return 0;
github heremaps / harp.gl / @here / harp-geometry / lib / SphericalGeometrySubdivisionModifier.ts View on Github external
protected shouldSplitTriangle(a: Vector3, b: Vector3, c: Vector3): number | undefined {
        const aa = sphereProjection.reprojectPoint(this.projection, a, VERTEX_POSITION_CACHE[0]);
        const bb = sphereProjection.reprojectPoint(this.projection, b, VERTEX_POSITION_CACHE[1]);
        const cc = sphereProjection.reprojectPoint(this.projection, c, VERTEX_POSITION_CACHE[2]);

        const alpha = aa.angleTo(bb);
        const beta = bb.angleTo(cc);
        const gamma = cc.angleTo(aa);

        // find the maximum angle
        const m = Math.max(alpha, Math.max(beta, gamma));

        // split the triangle if needed.
        if (m < this.angle) {
            return undefined;
        }

        if (m === alpha) {
            return 0;
        } else if (m === beta) {
github heremaps / harp.gl / @here / harp-geometry / lib / SphericalGeometrySubdivisionModifier.ts View on Github external
protected shouldSplitTriangle(a: Vector3, b: Vector3, c: Vector3): number | undefined {
        const aa = sphereProjection.reprojectPoint(this.projection, a, VERTEX_POSITION_CACHE[0]);
        const bb = sphereProjection.reprojectPoint(this.projection, b, VERTEX_POSITION_CACHE[1]);
        const cc = sphereProjection.reprojectPoint(this.projection, c, VERTEX_POSITION_CACHE[2]);

        const alpha = aa.angleTo(bb);
        const beta = bb.angleTo(cc);
        const gamma = cc.angleTo(aa);

        // find the maximum angle
        const m = Math.max(alpha, Math.max(beta, gamma));

        // split the triangle if needed.
        if (m < this.angle) {
            return undefined;
        }

        if (m === alpha) {