Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 260832 Details for
Bug 491402
Enhancement for Angle (getDeltaCW/CCW and isClockwise)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to add three methods to Angle
angle-deltacw.patch (text/plain), 1.67 KB, created by
Colin Sharples
on 2016-04-10 20:33:52 EDT
(
hide
)
Description:
Patch to add three methods to Angle
Filename:
MIME Type:
Creator:
Colin Sharples
Created:
2016-04-10 20:33:52 EDT
Size:
1.67 KB
patch
obsolete
>diff --git a/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/euclidean/Angle.java b/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/euclidean/Angle.java >index d14cce9..f0f34c2 100644 >--- a/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/euclidean/Angle.java >+++ b/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/euclidean/Angle.java >@@ -147,6 +147,45 @@ > } > > /** >+ * Returns the difference between this {@link Angle} and another >+ * {@link Angle} in a counter-clockwise direction >+ * >+ * @param other >+ * the other angle to compare to >+ * @return the difference between this {@link Angle} and another >+ * {@link Angle} in a counter-clockwise direction >+ */ >+ public Angle getDeltaCCW(Angle other) { >+ return new Angle(this.rad - other.rad); >+ } >+ >+ /** >+ * Returns the difference between this {@link Angle} and another >+ * {@link Angle} in a clockwise direction >+ * >+ * @param other >+ * the other angle to compare to >+ * @return the difference between this {@link Angle} and another >+ * {@link Angle} in a clockwise direction >+ */ >+ public Angle getDeltaCW(Angle other) { >+ return new Angle(other.rad - this.rad); >+ } >+ >+ /** >+ * Tests if the other {@link Angle} is within a half-circle clockwise >+ * rotation from this {@link Angle} >+ * >+ * @param other >+ * the other angle to compare to >+ * @return true if the a clockwise rotation to the other angle is less than >+ * 180deg >+ */ >+ public boolean isClockwise(Angle other) { >+ return getDeltaCW(other).rad <= RAD_180; >+ } >+ >+ /** > * Returns a new {@link Angle} object representing this {@link Angle} > * multiplied by the given factor. > *
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
nyssen
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 491402
: 260832 |
260874