fix(trigonometry): add arcsin() function#113
Merged
antfullstack merged 2 commits intoantfullstack:mainfrom Apr 12, 2026
Merged
Conversation
Implement arcsin(x) using the identity arcsin(x) = arctan(x / sqrt(1-x²)). - Accepts float or int in the range [-1, 1] - Raises ValueError for inputs outside the valid domain - Handles edge cases x = ±1 directly (returns ±π/2) - Returns result in radians, consistent with arctan()
Owner
|
Thank you! That will be merged, really appreciate your time and effort! |
This file contains hidden or 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.
Problem
Issue #110 requested an
arcsin()function intrigonometry.pyto complement the existingsin()andarctan()functions.Solution
Implemented
arcsin(x)using the identity:This leverages the existing
arctan()and thealgebra.sqrt()functions already in the codebase, keeping the implementation consistent with the project's style.Behaviour
float | intinput in the range[-1, 1]ValueErrorfor inputs outside the valid domainx = 1→π/2andx = -1→-π/2directlyFiles Changed
simple_equ/geometry/trigonometry.py— addedarcsin()function with full docstringVerification
Closes #110