How to print coordinates of a bunch of points -- Scripting?

Travis Jayday shared this question 1 year ago
Answered

Hello everyone.


I have a bunch of points (A-W), and I would like to print or get hold of the coordinates of all points in a simple text file (or print them somehow). I need the values of the x and y coordinates. How can I get all of them into an easily manageable text file using Geogebra Scripting? Is it possible?

Comments (1)

photo
1

Never mind, I figured it out. The documentation is quite sparse, but I stumbled across a post that helped me. This lists the x,y coordinates of points A - W


var str = "x&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspy<br>"


for (var i = 65; i <= 'W'.charCodeAt(0); i++) {


str += ggbApplet.getXcoord(String.fromCharCode(i)).toFixed(3) + " " + ggbApplet.getYcoord(String.fromCharCode(i)).toFixed(3) + "<br>"


}


var tab = window.open('about:blank', '_blank');


tab.document.write(str); // where 'html' is a variable containing your HTML


tab.document.close(); // to finish loading the page

© 2020 International GeoGebra Institute