use of net.sf.latexdraw.models.interfaces.shape.ICircle in project latexdraw by arnobl.
the class TestParsingPscircle method testCoordinatesRadius.
@Test
public void testCoordinatesRadius() {
parser("\\pscircle(35,20){10}");
ICircle cir = getShapeAt(0);
assertEquals(35d * IShape.PPC - 10d * IShape.PPC, cir.getPosition().getX(), 0.001);
assertEquals((20d * IShape.PPC - 10d * IShape.PPC) * -1d, cir.getPosition().getY(), 0.001);
assertEquals(10d * IShape.PPC * 2d, cir.getWidth(), 0.0000001);
assertEquals(10d * IShape.PPC * 2d, cir.getHeight(), 0.0000001);
}
use of net.sf.latexdraw.models.interfaces.shape.ICircle in project latexdraw by arnobl.
the class TestParsingPscircle method testCoordinatesInch.
@Test
public void testCoordinatesInch() {
parser("\\pscircle(35in,20in){1.2in}");
ICircle cir = getShapeAt(0);
assertEquals(35d * IShape.PPC / 2.54 - 1.2 * IShape.PPC / 2.54, cir.getPosition().getX(), 0.001);
assertEquals((20d * IShape.PPC / 2.54 - 1.2 * IShape.PPC / 2.54) * -1d, cir.getPosition().getY(), 0.001);
assertEquals(1.2 * IShape.PPC / 2.54 * 2d, cir.getWidth(), 0.0000001);
assertEquals(1.2 * IShape.PPC / 2.54 * 2d, cir.getHeight(), 0.0000001);
}
use of net.sf.latexdraw.models.interfaces.shape.ICircle in project latexdraw by arnobl.
the class TestParsingPscircle method testCoordinatesMm.
@Test
public void testCoordinatesMm() {
parser("\\pscircle(350mm,200mm){10mm}");
ICircle cir = getShapeAt(0);
assertEquals(35d * IShape.PPC - 1d * IShape.PPC, cir.getPosition().getX(), 0.001);
assertEquals((20d * IShape.PPC - 1d * IShape.PPC) * -1d, cir.getPosition().getY(), 0.001);
assertEquals(1d * IShape.PPC * 2d, cir.getWidth(), 0.0000001);
assertEquals(1d * IShape.PPC * 2d, cir.getHeight(), 0.0000001);
}
use of net.sf.latexdraw.models.interfaces.shape.ICircle in project latexdraw by arnobl.
the class TestParsingPscircle method testCoordinatesCm.
@Test
public void testCoordinatesCm() {
parser("\\pscircle(35cm,20cm){.5cm}");
ICircle cir = getShapeAt(0);
assertEquals(35d * IShape.PPC - .5 * IShape.PPC, cir.getPosition().getX(), 0.001);
assertEquals((20d * IShape.PPC - .5 * IShape.PPC) * -1d, cir.getPosition().getY(), 0.001);
assertEquals(.5 * IShape.PPC * 2d, cir.getWidth(), 0.0000001);
assertEquals(.5 * IShape.PPC * 2d, cir.getHeight(), 0.0000001);
}
use of net.sf.latexdraw.models.interfaces.shape.ICircle in project latexdraw by arnobl.
the class TestParsingPscircle method testFloatSigns.
@Test
public void testFloatSigns() {
parser("\\pscircle(+++35.5,--50.5){--+12}");
ICircle cir = getShapeAt(0);
assertEquals(35.5 * IShape.PPC - 12d * IShape.PPC, cir.getPosition().getX(), 0.001);
assertEquals((50.5 * IShape.PPC - 12d * IShape.PPC) * -1d, cir.getPosition().getY(), 0.001);
assertEquals(12d * IShape.PPC * 2d, cir.getWidth(), 0.0000001);
assertEquals(12d * IShape.PPC * 2d, cir.getHeight(), 0.0000001);
}
Aggregations