# Polar Coordinate Check

**URL:** https://cl.desmos.com/t/polar-coordinate-check/2656
**Category:** Discussion
**Created:** [February 12, 2021, 4:57am UTC](https://cl.desmos.com/t/polar-coordinate-check/2656 "2021-02-12T04:57:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MJL](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mjl/32/2145_2.png) [@MJL](https://cl.desmos.com/u/MJL)
#### Post date: [February 12, 2021, 4:57am UTC](https://cl.desmos.com/t/polar-coordinate-check/2656/1 "2021-02-12T04:57:25Z")

</div>

I want my students to enter the ordered pair for a polar coordinate using exact radian measures. How to I code it so that the student has to enter the answer as (4, -7pi/4)?

mypair = parseOrderedPair(this.latex)  
my\_x = numericValue(mypair.x)  
my\_y = numericValue(mypair.y)  
check=my\_x=4 and my\_y=-\frac{7\pi}{4}  
correct: check

I get the following error  
Syntax error: Unexpected token “-”

---

<div class="post-metadata">

### Author: ![Susan\_Lauer](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/susan_lauer/32/1832_2.png) [@Susan\_Lauer](https://cl.desmos.com/u/Susan_Lauer)
#### Post date: [February 12, 2021, 5:30pm UTC](https://cl.desmos.com/t/polar-coordinate-check/2656/2 "2021-02-12T17:30:09Z")

</div>

The recommended format is to use countNumberUsage and a range of values, so you would need to change your check to this:

```auto
check=my_x=4 and countNumberUsage(this.latex,4)=2 and (countNumberUsage(this.latex,-7)=1 or countNumberUsage(this.latex,7)=1) and my_y<-5.497 and my_y>-5.498

```

Because you are expecting an exact form (kind of like checking for spelling errors), you could possibly get away with replacing all of your code above with this LaTeX check for the whole point:

```auto
check=this.latex=`\left(4,-\frac{7\pi}{4}\right)` or this.latex=`\left(4,\frac{-7\pi}{4}\right)`
correct: check 

```

Note that both ways would need to include the possibilities for the negative before or with 7.

---

<div class="post-metadata">

### Author: ![MJL](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mjl/32/2145_2.png) [@MJL](https://cl.desmos.com/u/MJL)
#### Post date: [February 12, 2021, 6:18pm UTC](https://cl.desmos.com/t/polar-coordinate-check/2656/3 "2021-02-12T18:18:58Z")

</div>

I tried the second way and it worked - thank you so much 😀
