Issue #28 new

Line2D.getTheta()

hellochar avatarhellochar created an issue

A couple issues that I thought I should bring up:

a) When either line.a or line.b is (0, 0), line.getTheta() always returns PI/2; I feel like it should return NaN or something along those lines. I spent the last thirty minutes scratching my head at "1.5707964" before I realized the issue.

b) You should document that getTheta() returns the angle between the vectors defined by its two points; I was under the impression that it returned the line's angle with respect to the positive X-axis (that is, treating the line like a Vec2D "starting" at line.a and "ending" at line.b)

c) Again, documenting that Vec2D.getNormal() returns a Vec2D with zero as the dot product; I thought it returned a vector with equal angle and a magnitude of one.

Sorry if this is sounding a little nit-picky, just trying to help improve the library :)

Comments (0)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.