An open API service indexing awesome lists of open source software.

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).

Awesome Lists containing this project

README

          

# MagnitudeAngle

[![Build Status](https://travis-ci.org/ajkeller34/MagnitudeAngle.jl.svg?branch=master)](https://travis-ci.org/ajkeller34/MagnitudeAngle.jl)
[![Coverage Status](https://coveralls.io/repos/github/ajkeller34/MagnitudeAngle.jl/badge.svg?branch=master)](https://coveralls.io/github/ajkeller34/MagnitudeAngle.jl?branch=master)
[![codecov.io](http://codecov.io/github/ajkeller34/MagnitudeAngle.jl/coverage.svg?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
```