https://github.com/painterqubits/magnitudeangle.jl
Magnitude-angle representation of a Complex number (thin wrapper).
https://github.com/painterqubits/magnitudeangle.jl
complex-numbers julia
Last synced: 12 months ago
JSON representation
Magnitude-angle representation of a Complex number (thin wrapper).
- Host: GitHub
- URL: https://github.com/painterqubits/magnitudeangle.jl
- Owner: PainterQubits
- License: other
- Created: 2017-09-16T00:13:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-05-08T03:41:16.000Z (about 7 years ago)
- Last Synced: 2025-06-30T06:07:13.642Z (12 months ago)
- Topics: complex-numbers, julia
- Language: Julia
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# MagnitudeAngle
[](https://travis-ci.org/ajkeller34/MagnitudeAngle.jl)
[](https://coveralls.io/github/ajkeller34/MagnitudeAngle.jl?branch=master)
[](http://codecov.io/github/ajkeller34/MagnitudeAngle.jl?branch=master)
Simple wrapper around `Complex` numbers for displaying in a magnitude-angle format, and for providing a distinguishable type for dispatch.
Usage examples:
```
julia> using MagnitudeAngle
julia> MagAngle(1+3im)
3.1622776601683795 * exp(im * 71.56505117707799 °)
julia> MagAngle(10,π)
10.0 * exp(im * 180.0 °)
julia> typeof(ans)
MagnitudeAngle.MagAngle{Float64}
julia> MagAngle(1,0) + MagAngle(sqrt(3), pi/2) ≈ MagAngle(2, pi/3)
true
```