# How to find polar angle made by the line by joining the given point in cartesian plane with origin. I want a unique angle which will be from \[0,2\*pi)

**URL:** https://community.freefem.org/t/how-to-find-polar-angle-made-by-the-line-by-joining-the-given-point-in-cartesian-plane-with-origin-i-want-a-unique-angle-which-will-be-from-0-2-pi/2899
**Category:** General Discussion
**Created:** [January 22, 2024, 7:09am UTC](https://community.freefem.org/t/how-to-find-polar-angle-made-by-the-line-by-joining-the-given-point-in-cartesian-plane-with-origin-i-want-a-unique-angle-which-will-be-from-0-2-pi/2899 "2024-01-22T07:09:02Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![julienG](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/julieng/32/222_2.png) [@julienG](https://community.freefem.org/u/julienG)
#### Post date: [January 25, 2024, 5:52pm UTC](https://community.freefem.org/t/how-to-find-polar-angle-made-by-the-line-by-joining-the-given-point-in-cartesian-plane-with-origin-i-want-a-unique-angle-which-will-be-from-0-2-pi/2899/4 "2024-01-25T17:52:33Z")

</div>

Use [conditionnal expression operator `?`](http://en.cppreference.com/w/c/language/operator_other#Conditional_operator). It works as:

> condition ? expression-true : expression-false

so for your question:

`func f = ( (x==0.0 && y==0.0) ? 0.0 : ( x^2-y^2 > 0.0 ? x^2/(x^2+y^2) : y^2/(x^2+y^2) ) ); `

---

_[View the full topic](https://community.freefem.org/t/how-to-find-polar-angle-made-by-the-line-by-joining-the-given-point-in-cartesian-plane-with-origin-i-want-a-unique-angle-which-will-be-from-0-2-pi/2899)._
