コード例 #1
0
        public static RotoTranslation3 Enu(this GeoPoint3 origin, GeoDatum datum)
        {
            var ecefOrigin = origin.ToEcef(datum);

            var z = origin.EcefUp();
            var y = Vector3.UnitZ - z.Z * z;
            var x = y.Cross(z);

            return(new RotoTranslation3(Rotation3Utils.GramSchmidt(x, y), ecefOrigin));
        }
コード例 #2
0
        public static IPolygon3 CreateTriangle(Vector3 a, Vector3 b, Vector3 c)
        {
            var deltaB = b - a;
            var deltaC = c - a;

            var rotation = Rotation3Utils.GramSchmidt(deltaB, deltaC);

            var bNorm = Rotation3Utils.InvProductX(rotation, deltaB);
            var localC = Rotation3Utils.InvProductXY(rotation, deltaC);

            var polygon = new Polygon(new List<Vector2> 
            {
                Vector2.Zero,
                new Vector2(bNorm, 0),
                localC
            });

            return new Polygon3(new RotoTranslation3(rotation, a), polygon);
        }