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

library/math: Added standard math functions #49

Closed
wants to merge 1 commit into from

Conversation

obscuren
Copy link

Added standard math library, including:

  • Two dimensional euclidean distance
  • Square root
  • Linear interpolation

Added standard math library, including:

* Two dimensional euclidean distance
* Square root
* Linear interpolation
}

/// @dev Returns the linear interpolation between a and b
function lerp(uint x_a, uint y_a, uint x_b, uint y_b, uint delta) returns (uint x, uint y) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why lerp?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean with why?

Are you asking why I needed it here or are you asking about the reasoning behind adding it to a math lib?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think he's asking why the function is called lerp. FYI lerp is the canonical shortened name (I believe) for the Linear Interpolation function.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I see now. I should have paid closer attention to the implementation when asked to rename the functions.

@obscuren
Copy link
Author

Closing this in favour of #50 @VoR0220 took ownership.

@obscuren obscuren closed this Nov 22, 2015
@obscuren obscuren deleted the obscuren-patch-1 branch November 22, 2015 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants