Skip to content
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

Fix vector_magnitude_squared typo #188

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion coresdk/src/coresdk/circle_geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ namespace splashkit_lib
{
vector_2d pm_c = vector_point_to_point(from_pt, c.center);

double sqr_len = vector_magnitude_sqared(pm_c);
double sqr_len = vector_magnitude_squared(pm_c);
double r_sqr = c.radius * c.radius;

// Quick check for P inside the circle, return False if so
Expand Down
4 changes: 2 additions & 2 deletions coresdk/src/coresdk/vector_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ namespace splashkit_lib
return { -v.y / magnitude, v.x / magnitude };
}

double vector_magnitude_sqared(const vector_2d &v)
double vector_magnitude_squared(const vector_2d &v)
{
return (v.x * v.x) + (v.y * v.y);
}

double vector_magnitude(const vector_2d &v)
{
return sqrt(vector_magnitude_sqared(v));
return sqrt(vector_magnitude_squared(v));
}

vector_2d vector_limit(const vector_2d &v, double limit)
Expand Down
2 changes: 1 addition & 1 deletion coresdk/src/coresdk/vector_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ namespace splashkit_lib
* @param v The vector
* @return Its squared magnitude
*/
double vector_magnitude_sqared(const vector_2d &v);
double vector_magnitude_squared(const vector_2d &v);

/**
* Returns the magnitude (or "length") of the vector.
Expand Down
Loading