Search in sources :

Example 1 with Angle

use of eu.esdihumboldt.util.geometry.interpolation.model.Angle in project hale by halestudio.

the class ArcByCenterPointImpl method toArcByPoints.

/**
 * {@inheritDoc}
 *
 * @author Arun Verma
 */
@Override
public ArcByPoints toArcByPoints() {
    if (pointsRepresentation == null) {
        Angle middleAngle = Angle.fromRadians(startAngle.getRadians() + 0.5 * getAngleBetween().getRadians());
        // getting start coordinate
        Coordinate startPoint = getPointAtAngle(startAngle);
        // getting end coordinate
        Coordinate endPoint = getPointAtAngle(endAngle);
        // will generate middle coordinate to use already coded arc
        // interpolation
        Coordinate middlePoint = getPointAtAngle(middleAngle);
        pointsRepresentation = new ArcByPointsImpl(startPoint, middlePoint, endPoint);
    }
    return pointsRepresentation;
}
Also used : Angle(eu.esdihumboldt.util.geometry.interpolation.model.Angle) Coordinate(com.vividsolutions.jts.geom.Coordinate)

Example 2 with Angle

use of eu.esdihumboldt.util.geometry.interpolation.model.Angle in project hale by halestudio.

the class ArcByPointsImpl method toArcByCenterPoint.

@Override
public ArcByCenterPoint toArcByCenterPoint() {
    if (centerRepresentation == null) {
        Coordinate centerPoint = calculateCenterPoint();
        double radius = Math.sqrt(Math.pow((startPoint.x - centerPoint.x), 2) + Math.pow((startPoint.y - centerPoint.y), 2));
        Angle startAngle = Angle.angle(centerPoint, startPoint);
        Angle endAngle = Angle.angle(centerPoint, endPoint);
        boolean clockwise = isClockwise(centerPoint);
        centerRepresentation = new ArcByCenterPointImpl(centerPoint, radius, startAngle, endAngle, clockwise);
    }
    return centerRepresentation;
}
Also used : Angle(eu.esdihumboldt.util.geometry.interpolation.model.Angle) Coordinate(com.vividsolutions.jts.geom.Coordinate)

Example 3 with Angle

use of eu.esdihumboldt.util.geometry.interpolation.model.Angle in project hale by halestudio.

the class ArcGridSegment method getFirstPart.

@Override
public ArcSegment getFirstPart() {
    ArcByCenterPoint byCenter = arc.toArcByCenterPoint();
    Angle middleAngle = Angle.fromRadians(byCenter.getStartAngle().getRadians() + 0.5 * byCenter.getAngleBetween().getRadians());
    Arc part = new ArcByCenterPointImpl(byCenter.getCenterPoint(), byCenter.getRadius(), byCenter.getStartAngle(), middleAngle, byCenter.isClockwise());
    // match the parent segment's
    return new FixedStartEndGridSegment(part, true, gridSize, getStartPoint(), getMiddlePoint());
}
Also used : ArcByCenterPoint(eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint) Arc(eu.esdihumboldt.util.geometry.interpolation.model.Arc) Angle(eu.esdihumboldt.util.geometry.interpolation.model.Angle) ArcByCenterPointImpl(eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl)

Example 4 with Angle

use of eu.esdihumboldt.util.geometry.interpolation.model.Angle in project hale by halestudio.

the class ArcGridSegment method getSecondPart.

@Override
public ArcSegment getSecondPart() {
    ArcByCenterPoint byCenter = arc.toArcByCenterPoint();
    Angle middleAngle = Angle.fromRadians(byCenter.getStartAngle().getRadians() + 0.5 * byCenter.getAngleBetween().getRadians());
    Arc part = new ArcByCenterPointImpl(byCenter.getCenterPoint(), byCenter.getRadius(), middleAngle, byCenter.getEndAngle(), byCenter.isClockwise());
    // match the parent segment's
    return new FixedStartEndGridSegment(part, true, gridSize, getMiddlePoint(), getEndPoint());
}
Also used : ArcByCenterPoint(eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint) Arc(eu.esdihumboldt.util.geometry.interpolation.model.Arc) Angle(eu.esdihumboldt.util.geometry.interpolation.model.Angle) ArcByCenterPointImpl(eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl)

Example 5 with Angle

use of eu.esdihumboldt.util.geometry.interpolation.model.Angle in project hale by halestudio.

the class ArcSplitSegment method getSecondPart.

@Override
public ArcSegment getSecondPart() {
    ArcByCenterPoint byCenter = arc.toArcByCenterPoint();
    Angle middleAngle = Angle.fromRadians(byCenter.getStartAngle().getRadians() + 0.5 * byCenter.getAngleBetween().getRadians());
    Arc part = new ArcByCenterPointImpl(byCenter.getCenterPoint(), byCenter.getRadius(), middleAngle, byCenter.getEndAngle(), byCenter.isClockwise());
    return new FixedStartEndSplitSegment(part, maxPositionalError, getMiddlePoint(), getEndPoint());
}
Also used : ArcByCenterPoint(eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint) Arc(eu.esdihumboldt.util.geometry.interpolation.model.Arc) Angle(eu.esdihumboldt.util.geometry.interpolation.model.Angle) ArcByCenterPointImpl(eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl)

Aggregations

Angle (eu.esdihumboldt.util.geometry.interpolation.model.Angle)6 Arc (eu.esdihumboldt.util.geometry.interpolation.model.Arc)4 ArcByCenterPoint (eu.esdihumboldt.util.geometry.interpolation.model.ArcByCenterPoint)4 ArcByCenterPointImpl (eu.esdihumboldt.util.geometry.interpolation.model.impl.ArcByCenterPointImpl)4 Coordinate (com.vividsolutions.jts.geom.Coordinate)2