Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 491402 | Differences between
and this patch

Collapse All | Expand All

(-)a/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/euclidean/Angle.java (+39 lines)
Lines 147-152 Link Here
147
	}
147
	}
148
148
149
	/**
149
	/**
150
	 * Returns the difference between this {@link Angle} and another
151
	 * {@link Angle} in a counter-clockwise direction
152
	 *
153
	 * @param other
154
	 *            the other angle to compare to
155
	 * @return the difference between this {@link Angle} and another
156
	 *         {@link Angle} in a counter-clockwise direction
157
	 */
158
	public Angle getDeltaCCW(Angle other) {
159
		return new Angle(this.rad - other.rad);
160
	}
161
162
	/**
163
	 * Returns the difference between this {@link Angle} and another
164
	 * {@link Angle} in a clockwise direction
165
	 *
166
	 * @param other
167
	 *            the other angle to compare to
168
	 * @return the difference between this {@link Angle} and another
169
	 *         {@link Angle} in a clockwise direction
170
	 */
171
	public Angle getDeltaCW(Angle other) {
172
		return new Angle(other.rad - this.rad);
173
	}
174
175
	/**
176
	 * Tests if the other {@link Angle} is within a half-circle clockwise
177
	 * rotation from this {@link Angle}
178
	 *
179
	 * @param other
180
	 *            the other angle to compare to
181
	 * @return true if the a clockwise rotation to the other angle is less than
182
	 *         180deg
183
	 */
184
	public boolean isClockwise(Angle other) {
185
		return getDeltaCW(other).rad <= RAD_180;
186
	}
187
	
188
	/**
150
	 * Returns a new {@link Angle} object representing this {@link Angle}
189
	 * Returns a new {@link Angle} object representing this {@link Angle}
151
	 * multiplied by the given factor.
190
	 * multiplied by the given factor.
152
	 *
191
	 *

Return to bug 491402