Example #1
0
        public static void TestConvert()
        {
            var pivoter = TP(bp => RV2ToXY(V2V2F(PX(BPYRepo.T())(bp), PY(BPYRepo.P())(bp), BPYRepo.X()(bp))));
            var bpi     = new ParametricInfo(Vector2.left * 30, 4, 0, 3.5f);

            VecEq(pivoter(bpi), new V2RV2(3.5f, 0, 0, 4, -30).TrueLocation);
        }
Example #2
0
        public static void TPivot()
        {
            var pivoter = TP(Pivot(BPYRepo.T(), _ => 3f, bp => PolarToXY(1f, bp.t.Mul(90f)),
                                   PX(bp => Mul <float>(bp.t, 2f))));
            var bpi = ParametricInfo.WithRandomId(Vector2.down * 100f, 0);

            bpi.t = 0f;
            TAssert.VecEq(pivoter(bpi), Vector2.right);
            bpi.t = 2f;
            TAssert.VecEq(pivoter(bpi), Vector2.left);
            bpi.t = 3f;
            TAssert.VecEq(pivoter(bpi), Vector2.down);
            bpi.t = 4f;
            TAssert.VecEq(pivoter(bpi), new Vector2(2f, -1f));
            bpi.t = 5f;
            TAssert.VecEq(pivoter(bpi), new Vector2(4f, -1f));
        }