Exemplo n.º 1
0
    public void ScaleAndTranslatePoint3()
    {
        var tp = new Cartesian(500.0, 500.0);
        var sp = new Cartesian(300.0 / 6000.0, -300.0 / 6000.0);
        var m  = Matrix33.CreateMatrix(sp, tp, 0.0);
        var a  = new Cartesian(0.0, 6000.0);
        var b  = m.Transform(a);

        Assert.That(b.X, Is.EqualTo(500.0));
        Assert.That(b.Y, Is.EqualTo(200.0));
    }
Exemplo n.º 2
0
    public void RotateScaleAndTranslatePoint()
    {
        var tp = new Cartesian(500.0, 500.0);
        var sp = new Cartesian(500.0 / 1000.0, -500.0 / 1000.0);
        var m  = Matrix33.CreateMatrix(sp, tp, Algorithms.ToRadians(30.0));
        var a  = new Cartesian(500.0, 100.0);
        var b  = m.Transform(a);

        Assert.That(IsApproximately(b.X, 691.506, 0.001));
        Assert.That(IsApproximately(b.Y, 331.699, 0.001));
    }
Exemplo n.º 3
0
    public void ScaleAndTranslatePoint()
    {
        var tp = new Cartesian(5.0, 10.0);
        var sp = new Cartesian(0.5, 0.25);
        var m  = Matrix33.CreateMatrix(sp, tp, 0.0);
        var a  = new Cartesian(100.0, 100.0);
        var b  = m.Transform(a);

        Assert.That(b.X, Is.EqualTo(55.0));
        Assert.That(b.Y, Is.EqualTo(35.0));
    }