Examples of toDegrees()


Examples of com.cburch.logisim.data.Direction.toDegrees()

    Graphics2D g = (Graphics2D) painter.getGraphics().create();
    Location loc = painter.getLocation();
    g.translate(loc.getX(), loc.getY());

    Direction from = painter.getAttributeValue(StdAttr.FACING);
    int degrees = Direction.EAST.toDegrees() - from.toDegrees();
    double radians = Math.toRadians((degrees + 360) % 360);
    g.rotate(radians);

    GraphicsUtil.switchToWidth(g, Wire.WIDTH);
    if (!isGhost && painter.getShowState()) {
View Full Code Here

Examples of com.cburch.logisim.data.Direction.toDegrees()

    Graphics2D g = (Graphics2D) painter.getGraphics().create();
    Location loc = painter.getLocation();
    g.translate(loc.getX(), loc.getY());

    Direction from = painter.getAttributeValue(StdAttr.FACING);
    int degrees = Direction.EAST.toDegrees() - from.toDegrees();
    double radians = Math.toRadians((degrees + 360) % 360);
    g.rotate(radians);

    GraphicsUtil.switchToWidth(g, Wire.WIDTH);
    if (!isGhost && painter.getShowState()) {
View Full Code Here

Examples of com.cburch.logisim.data.Direction.toDegrees()

    Object powerLoc = painter.getAttributeValue(Wiring.ATTR_GATE);
    Direction facing = painter.getAttributeValue(StdAttr.FACING);
    boolean flip = (facing == Direction.SOUTH || facing == Direction.WEST)
      == (powerLoc == Wiring.GATE_TOP_LEFT);

    int degrees = Direction.WEST.toDegrees() - facing.toDegrees();
    if (flip) degrees += 180;
    double radians = Math.toRadians((degrees + 360) % 360);

    Graphics2D g = (Graphics2D) painter.getGraphics().create();
    g.rotate(radians, bds.getX() + 20, bds.getY() + 20);
View Full Code Here

Examples of com.cburch.logisim.data.Direction.toDegrees()

        Object powerLoc = painter.getAttributeValue(Wiring.ATTR_GATE);
        Direction facing = painter.getAttributeValue(StdAttr.FACING);
        boolean flip = (facing == Direction.SOUTH || facing == Direction.WEST)
            == (powerLoc == Wiring.GATE_TOP_LEFT);

        int degrees = Direction.WEST.toDegrees() - facing.toDegrees();
        if (flip) {
            degrees += 180;
        }

        double radians = Math.toRadians((degrees + 360) % 360);
View Full Code Here

Examples of com.cburch.logisim.data.Direction.toDegrees()

        Graphics2D g = (Graphics2D) painter.getGraphics().create();
        Location loc = painter.getLocation();
        g.translate(loc.getX(), loc.getY());

        Direction from = painter.getAttributeValue(StdAttr.FACING);
        int degrees = Direction.EAST.toDegrees() - from.toDegrees();
        double radians = Math.toRadians((degrees + 360) % 360);
        g.rotate(radians);

        GraphicsUtil.switchToWidth(g, Wire.WIDTH);
        if (!isGhost && painter.getShowState()) {
View Full Code Here

Examples of com.cburch.logisim.data.Direction.toDegrees()

        Graphics2D g = (Graphics2D) painter.getGraphics().create();
        Location loc = painter.getLocation();
        g.translate(loc.getX(), loc.getY());

        Direction from = painter.getAttributeValue(StdAttr.FACING);
        int degrees = Direction.EAST.toDegrees() - from.toDegrees();
        double radians = Math.toRadians((degrees + 360) % 360);
        g.rotate(radians);

        GraphicsUtil.switchToWidth(g, Wire.WIDTH);
        if (!isGhost && painter.getShowState()) {
View Full Code Here

Examples of org.aavso.tools.vstar.util.coords.DecInfo.toDegrees()

  // Test cases.
 
  public void testDecToDegrees1() {
    DecInfo dec = new DecInfo(EPOCH, 0, 0, 0);
    assertEquals(0.0, dec.toDegrees());
  }

  public void testDecToDegrees2() {
    DecInfo dec = new DecInfo(EPOCH, -25, 45, 3);
    String decStr = getNumToPrecision(dec.toDegrees(), PRECISION);
View Full Code Here

Examples of org.aavso.tools.vstar.util.coords.DecInfo.toDegrees()

    assertEquals(0.0, dec.toDegrees());
  }

  public void testDecToDegrees2() {
    DecInfo dec = new DecInfo(EPOCH, -25, 45, 3);
    String decStr = getNumToPrecision(dec.toDegrees(), PRECISION);
    assertEquals(getNumToPrecision(-25.7508333333333, PRECISION), decStr);
  }

  public void testDecToDegrees3() {
    DecInfo dec = new DecInfo(EPOCH, 2, 0, 0);
View Full Code Here

Examples of org.aavso.tools.vstar.util.coords.DecInfo.toDegrees()

    assertEquals(getNumToPrecision(-25.7508333333333, PRECISION), decStr);
  }

  public void testDecToDegrees3() {
    DecInfo dec = new DecInfo(EPOCH, 2, 0, 0);
    assertEquals(2.0, dec.toDegrees());
  }
 
  // Helpers
 
  private String getNumToPrecision(double n, int precision) {
View Full Code Here

Examples of org.aavso.tools.vstar.util.coords.RAInfo.toDegrees()

  // Test cases.
 
  public void testRAToDegrees1() {
    RAInfo ra = new RAInfo(EPOCH, 0, 0, 0);
    assertEquals(0.0, ra.toDegrees());
  }

  public void testRAToDegrees2() {
    RAInfo ra = new RAInfo(EPOCH, 15, 2, 3.6);
    assertEquals(225.515, ra.toDegrees());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.