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 251189 Details for
Bug 460754
Add getLength() method to Line
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 for Line.getDirection method
460754-Line-getDirection.patch (text/plain), 968 bytes, created by
Colin Sharples
on 2015-02-28 18:21:46 EST
(
hide
)
Description:
Patch for Line.getDirection method
Filename:
MIME Type:
Creator:
Colin Sharples
Created:
2015-02-28 18:21:46 EST
Size:
968 bytes
patch
obsolete
>diff --git a/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/planar/Line.java b/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/planar/Line.java >index 612acff..0bff0c5 100644 >--- a/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/planar/Line.java >+++ b/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/planar/Line.java >@@ -18,2 +18,3 @@ > >+import org.eclipse.gef4.geometry.euclidean.Angle; > import org.eclipse.gef4.geometry.euclidean.Straight; >@@ -179,2 +180,15 @@ > /** >+ * Returns the angle from the start {@link Point} to the end {@link Point} >+ * of this {@link Line} >+ * >+ * @return the angle from the start {@link Point} to the end {@link Point} >+ * of this {@link Line} >+ */ >+ public Angle getDirection() { >+ Point start = getP1(); >+ Point end = getP2(); >+ return Angle.fromRad(Math.atan2(end.y - start.y, end.x - start.y)); >+ } >+ >+ /** > * Returns the single intersection point between this {@link Line} and the
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:
matthias.wienand
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 460754
:
251187
|
251188
| 251189 |
251190