# Can I access one of the coordinates of a point?

gbell12 shared this question 9 years ago

I'd like to have point P=(5, 6) and be able to do something with the '6' in an equation. I've gone through the docs and can't find how to do this...

Thanks!

1

Hi, try x(p) and y(P).

1

Thanks! Bloody hell I spent a long time looking for that in the documentation. :D

1

Hi and welcome!

The forum is always a good place to get a quick reply! (Especially after a fruitless search!) This page from the on-line manual might be useful: http://wiki.geogebra.org/en...

Kathryn

1

Hi, try x(p) and y(P).

Just for the record, since GeoGebra is case sensitive and points are "P" and vectors are "p", for my case with points, that should actually be x(P) and y(P).

If you instead have a vector "p", then x(p) and y(p) work as expected.

Thanks again!

1

Does the corollary work? E.g. Use x(P) = 5 to set the x coordinate of a point to 5 or do we have to use SetCoords?

SetCoords requires an x and y value, so what if we only want to set the x coordinate?