-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vectors Package Update #2
Open
ttchalakov
wants to merge
67
commits into
master
Choose a base branch
from
vectors
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addition to the geometry package adds an abstract framework for geometric vectors which are distinctly different from linear algebra vectors as the polar, spherical, and cylindrical coordinate systems are not linear combinations of any basis. This design is chosen because the purpose of this pull request is to introduce tools for physical representations of locations in space through the addition of other common coordinate systems (polar, spherical, cylindrical). It is recommended to use EJML vectors to work with other vector quantities.
The packages includes templated interfaces to help generalize the designs of vectors for geometric applications. Currently cartesian 2D, polar, cartesian 3D, spherical, and cylindrical coordinate systems are implemented and unit tests. More can be added to this API but the current vectors are largely exhaustive for effectively all purposes. Bullet point 2 in Future Considerations includes ideas for other useful vectors.
Vectors for Geometry
A good vector library is clearly necessary. While EJML could be used directly for linear vector spaces such as cartesian, it doesn't work for polar, spherical, or cylindrical systems. On another note, a library for vectors that describe geometric locations can also provide many extra convenience features. It should be noted that this packages considers points to be distinct from vectors and that they do not have operations on them so making a point class would make a container object for the point. It is recommended to use vectors to represent locations in space from an origin.
The Coordinate Systems
Cartesian
The most familiar system to everyone is the cartesian system which is (x,y) and (x,y,z) in 2D and 3D respectively. If a review is needed follow this link.
Polar, Spherical, and Cylindrical
The polar coordinate systems is the ordered pair (r, theta) where theta is in radians. Polar coordinates along with spherical and cylindrical are implemented to be bijective from all other coordinate systems. A bijective coordinate system is injective and surjective meaning that there is a unique values from one coordinate system to another and that all values can be converted. However in the case of r and rho equal to 0 any theta can be used to describe values along the z axis in cylindrical coordinate and any theta value can be used for the spherical system to represent the origin at (0,0,0) cartesian.
Polar
Spherical
Cylindrical
Usage
The library is meant to have static objects as it makes it easier to write equations which can be done by chaining then one after another:
Future Considerations