Skip to content

Polar coordinate representation #35576

Open
@Ronneesley

Description

Hello,

In electric systems is common to use polar coordinates with module and angle.

They are written like that:
module ∠ angle

It would be great if the operator ∠ were allowed in Julia lang as a binary operator.

So, someone could create your own operations. But, if this representation and operations were in native Julia Lang, it would be awesome.

I think this representation like complex numbers (Complex).

I'm not mathematician, but I guess all operations could be wrapped with complex numbers, like this:

+(p1::Polar, p2::Polar) = polar(complex(p1) + complex(p2))

I'm imagining that complex() cast Polar to Complex and polar() cast Complex to Polar.

So, I would like to propose a debate about two scenarios:

  1. Allow the operator ∠
  2. Allow the operator ∠ and incorporate all operations in Julia

I hope this contributes to the language and I hope I have expressed myself correctly.

Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    breakingThis change will break codecomplexComplex numbersparserLanguage parsing and surface syntaxspeculativeWhether the change will be implemented is speculative

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions