Setting line coordinates

Marek Nedvěd shared this question 3 years ago
Needs Answer

Hello,


I have a problem with setting coordinates of existing line. At the other hand, setting coordinates of points works fine.


I made arbitrary line f with Line tool. Then I set a javascript inside a button:

ggbApplet.setCoords("f", 1, 1, 1);


But nothing happens.


As I wrote, setting a coordinates of point works well by this way. Could you advice me, please?

Comments (9)

photo
1

setCoords() is for Points - try setting the coords of A and B

photo
1

Are you sure? There is written something different:505f7f45ede4f59c9c84bd6efcb3326c

photo
photo
1

Hello


Do you really think that a line have 3 coordinates..?

https://wiki.geogebra.org/e...

photo
1

Yes I do, the third coordinate is the absolute term "c" in equation: ax + by + c = 0


Try it:


ggbApplet.getXcoord("some_line_name");

ggbApplet.getYcoord("some_line_name");

ggbApplet.getZcoord("some_line_name");

photo
photo
1

por muy absurdo que me parecía la explicación he probado a ver qué pasaba

primero he creado una recta libre escribiendo x+2y=3 (no usando dos puntos; escribiendo)

después he deseleccionado la casilla fix (a no fijo) en las propiedades de la recta

a continuación he escrito setcoords(eq1,4,5,6) and OHH! sorpresa!!!

photo
1

it was so absurd that i didn't try..!

But it doesn't work in scripts...

photo
photo
1

be sure the line is not fix

the script works

Files: foro.ggb
photo
1

ok (perhaps don't fix line is the solution for Marek)


Finally, this is difference between mathematic and computing

coordinate of line is absurd for mathematics but not for computing

(other example : f=2x is absurd for mathematics but f(x)=2x is absurd for computing !)

photo
1

Depends how you look at it

In general, there is no difference either algebraically or logically between the homogeneous coordinates of points and lines

https://en.wikipedia.org/wi...

photo
© 2023 International GeoGebra Institute