https://github.com/hermesiss/unity-mathf-extensions
Mathf extensions for more RX-ish style
https://github.com/hermesiss/unity-mathf-extensions
extension math mathf-unity3d unity
Last synced: about 1 month ago
JSON representation
Mathf extensions for more RX-ish style
- Host: GitHub
- URL: https://github.com/hermesiss/unity-mathf-extensions
- Owner: Hermesiss
- Created: 2020-06-14T09:02:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-04T09:37:10.000Z (almost 6 years ago)
- Last Synced: 2025-09-09T01:23:47.973Z (10 months ago)
- Topics: extension, math, mathf-unity3d, unity
- Language: C#
- Homepage:
- Size: 60.5 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unity Mathf Extensions
## What is this?
Unity [Mathf](https://docs.unity3d.com/ScriptReference/Mathf.html) extensions for more RX-ish style so you can write
```csharp
var result = a * b * .5f * ((a / b * a2.Tan()).Atan() - (a / b * a1.Tan()).Atan());
```
instead of
```csharp
var result = a * b * .5f * (Mathf.Atan(a / b * Mathf.Tan(a2)) - Mathf.Atan(a / b * Mathf.Tan(a1)));
```
## Features
* All `UnityEngine.Mathf` methods
* Standard [operators and expressions](https://docs.microsoft.com/en-gb/dotnet/csharp/language-reference/operators/)
* Arithmetical `Add`, `Sub`, `Mul`, `Div`, `Frac`
* Logical `Neg`, `And`, `Or`, `Xor`, `AndCond`, `OrCond`
* Bitwise `BitComplement`, `BitLeftShift`, `BitRightShift`, `BitAnd`, `BitOr`, `BitXor`
* Comparison `Less`, `LessEqual`, `Great`, `GreatEqual`
## Installation
You have several options
### From registry
First, you need to add a scoped registry to `Packages/manifest.json`:
```json
"scopedRegistries": [
{
"name": "trismegistus",
"url": "http://upm.trismegistus.tech:4873/",
"scopes": [
"trismegistus.unity"
]
}
]
```
Then open `Window/Package manager`, `All packages`, and install `Trismegistus Mathf Extensions`
### From git url
1. Open `Window/Package manager`
2. `+`, `Add from git URL`
3. Enter `https://github.com/Hermesiss/unity-mathf-extensions.git?path=/Packages/trismegistus.unity.mathf-extensions`