# How can I parse coordinates in CL?

**URL:** <https://cl.desmos.com/t/how-can-i-parse-coordinates-in-cl/64>\
**Category:** Questions\
**Created:** [May 9, 2018, 12:40am UTC](https://cl.desmos.com/t/how-can-i-parse-coordinates-in-cl/64 "2018-05-09T00:40:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryn](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/bryn/32/40_2.png) [@Bryn](https://cl.desmos.com/u/Bryn)\
**Post date:** [May 9, 2018, 12:40am UTC](https://cl.desmos.com/t/how-can-i-parse-coordinates-in-cl/64/1 "2018-05-09T00:40:46Z")

</div>

I’ve got an expression where students are to enter some coordinates like (4, 5) and I want to extract the x and y components.

How can I do this in CL?

---

<div class="post-metadata">

**Author:** ![eric](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/eric/32/10_2.png) [@eric](https://cl.desmos.com/u/eric)\
**Post date:** [May 9, 2018, 7:06am UTC](https://cl.desmos.com/t/how-can-i-parse-coordinates-in-cl/64/2 "2018-05-09T07:06:04Z")

</div>

There’s a function “parseOrderedPair”, which converts latex input to an object with an “x” and a “y” member, which are the string values of what a student typed. As one example:

```auto
myPair = parseOrderedPair("(4,5)")
content: "That pair means X = ${myPair.x} and Y = ${myPair.y}"

```

You can see a working version here: [Note • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/5af29d027cc0500a9c64cea6)

The x and y members will be latex strings, so you can use simpleFunction() to parse them if you want to plug in variable values, like we do in [Blue Point Rule • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/573d0086d3c48c180bd801ab), or you can use numericValue() if you just want to interpret them as numbers.

---

<div class="post-metadata">

**Author:** ![Bryn](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/bryn/32/40_2.png) [@Bryn](https://cl.desmos.com/u/Bryn)\
**Post date:** [May 9, 2018, 9:35am UTC](https://cl.desmos.com/t/how-can-i-parse-coordinates-in-cl/64/3 "2018-05-09T09:35:38Z")

</div>

Thanks! I see that it is included in the docs as the example for numericValue, but will it also get its own status as a function in that list?

---

<div class="post-metadata">

**Author:** ![eric](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/eric/32/10_2.png) [@eric](https://cl.desmos.com/u/eric)\
**Post date:** [May 9, 2018, 1:18pm UTC](https://cl.desmos.com/t/how-can-i-parse-coordinates-in-cl/64/4 "2018-05-09T13:18:05Z")

</div>

Yes. We’re still expanding documentation for functions and some of the more complex data types (layers, sketches, pairs, lines)
