Search in sources :

Example 16 with Rhombus

use of net.sf.latexdraw.model.api.shape.Rhombus in project latexdraw by arnobl.

the class TestParsingPsdiamond method testCoordinatesPt.

@Test
public void testCoordinatesPt() {
    parser("\\psdiamond(0,0)(35pt,20pt)");
    final Rhombus rh = getShapeAt(0);
    assertEquals(-35d * Shape.PPC / PSTricksConstants.CM_VAL_PT, rh.getPosition().getX(), 0.001);
    assertEquals(-20d * Shape.PPC / PSTricksConstants.CM_VAL_PT * -1d, rh.getPosition().getY(), 0.001);
    assertEquals(35d * Shape.PPC / PSTricksConstants.CM_VAL_PT * 2d, rh.getWidth(), 0.001);
    assertEquals(20d * Shape.PPC / PSTricksConstants.CM_VAL_PT * 2d, rh.getHeight(), 0.001);
}
Also used : Rhombus(net.sf.latexdraw.model.api.shape.Rhombus) Test(org.junit.jupiter.api.Test)

Example 17 with Rhombus

use of net.sf.latexdraw.model.api.shape.Rhombus in project latexdraw by arnobl.

the class TestParsingPsdiamond method testParse1Coordinates.

@Test
public void testParse1Coordinates() {
    parser("\\psdiamond(35,20)");
    final Rhombus rh = getShapeAt(0);
    assertEquals(-35d * Shape.PPC, rh.getPosition().getX(), 0.001);
    assertEquals(-20d * Shape.PPC * -1d, rh.getPosition().getY(), 0.001);
    assertEquals(35d * Shape.PPC * 2d, rh.getWidth(), 0.001);
    assertEquals(20d * Shape.PPC * 2d, rh.getHeight(), 0.001);
}
Also used : Rhombus(net.sf.latexdraw.model.api.shape.Rhombus) Test(org.junit.jupiter.api.Test)

Example 18 with Rhombus

use of net.sf.latexdraw.model.api.shape.Rhombus in project latexdraw by arnobl.

the class TestParsingPsdiamond method testGangle.

@Test
public void testGangle() {
    parser("\\psdiamond[gangle=90](0,0)(1,1)");
    final Rhombus rh = getShapeAt(0);
    assertEquals(-Math.PI / 2d, rh.getRotationAngle(), 0.001);
}
Also used : Rhombus(net.sf.latexdraw.model.api.shape.Rhombus) Test(org.junit.jupiter.api.Test)

Aggregations

Rhombus (net.sf.latexdraw.model.api.shape.Rhombus)18 Test (org.junit.jupiter.api.Test)14 HelperTest (net.sf.latexdraw.HelperTest)3 Test (org.junit.Test)3 Circle (net.sf.latexdraw.model.api.shape.Circle)2 Rectangle (net.sf.latexdraw.model.api.shape.Rectangle)2 Axes (net.sf.latexdraw.model.api.shape.Axes)1 BezierCurve (net.sf.latexdraw.model.api.shape.BezierCurve)1 CircleArc (net.sf.latexdraw.model.api.shape.CircleArc)1 Dot (net.sf.latexdraw.model.api.shape.Dot)1 Ellipse (net.sf.latexdraw.model.api.shape.Ellipse)1 Freehand (net.sf.latexdraw.model.api.shape.Freehand)1 Grid (net.sf.latexdraw.model.api.shape.Grid)1 Plot (net.sf.latexdraw.model.api.shape.Plot)1 Polygon (net.sf.latexdraw.model.api.shape.Polygon)1 Polyline (net.sf.latexdraw.model.api.shape.Polyline)1 PositionShape (net.sf.latexdraw.model.api.shape.PositionShape)1 RectangularShape (net.sf.latexdraw.model.api.shape.RectangularShape)1 Shape (net.sf.latexdraw.model.api.shape.Shape)1 Square (net.sf.latexdraw.model.api.shape.Square)1