Properties
Similar Topics
Statistics
Comments
16
Participants
6
Subscribers
5
Votes
2
Views
1088
Share
Get current zooming factor
Answered
Hello,
What is the script for getting current zooming factor of the GeoGebra view?
Background: in the example of snapping a point to other object or point, the boolean (distance() < 0.1) triggers snapping the point through DynamicCoordinates. How can we set 0.1 to be a number proportional to the zooming factor, such that when the object is zoomed in, the same amount of "magniticy" is applied. (consider for example when you zoom in to more than distance of 0.1, what will happen when you try to get the point out of the snapping zone?)
 GeoGebra
 Help
 Partners

Contact us
 Feedback & Questions
 This email address is being protected from spambots. You need JavaScript enabled to view it.
 +43 677 6137 2693
© 2022 International GeoGebra Institute
zoomin is undependent for each axes so the general answer is not possible
if you want the zoom for xAxis you can do (x(Corner(5)) + 2) / 50 / x(Corner(3)  Corner(1))
Hi,
https://wiki.geogebra.org/en/ZoomIn_Command
https://wiki.geogebra.org/en/ZoomOut_Command
"Current zooming factor" does not exist.
However you may want to read
https://wiki.geogebra.org/en/Corner_Command
You can calculate based on the coordinate system you have set up, what are the coordinates of the extent of your specific graphics window view.
May I leave you to read https://wiki.geogebra.org/en/Corner_Command
and see example at https://www.geogebra.org/cl...
Regards,
lewws
zoomin is undependent for each axes so the general answer is not possible
if you want the zoom for xAxis you can do (x(Corner(5)) + 2) / 50 / x(Corner(3)  Corner(1))
The goal is to calculate the distance of 2 points in (pixels if the x/y ratio not is 1/1)
This is possible with the formula in the attachment (I think)

But:
There is another question still unresolved for me:
How to draw a perpendicular to a path if the X/Yratio is not 1/1. The perpendicular should appear in 90° on the screen (that mean the angle look on the screen alway same, also when the X/Yratio is changed).
This is the prerequisite for determining the closestPointOnPath on the screen (not calculatet in GGBunits by GGB) between a path and a point when the X/Y ratio is not 1/1.
espero que el adjunto se explique solo, aunque esté calculado en español
Thank you very much mathmagic,
.
I think instead of Spanish, I'm going to learn the matrix calculus.
So I would be able to really appreciate your work.
And, maybe, then I might be able to create what I really want by myself.

Finally, I wanna:
I have a path c and a point P
I want the C=ClosestPoint(c,p) so that if the ratio XY is not 1:1, the picture on the screen looks like it is 1:1. So that Distance(C,D) in pixels (viewed on the screen) is the smallest possible value.

story until now:
I wanted to reach this step by step. First with point and straight line.
I even achieved this (method TrailAndError). Only, unfortunately I don't understand why it works (if it does).
In the attachment my "solution" only to clarify what I am looking for.
And logically, with this not knowing, I do not reach the final goal (ClosestPointInPixel).

I hope to formulate understandingly what I am looking for.
I would be pleased if you could support me in this task (of course with the "magic Spanish matrix", if possible).

Note: I use deepL (mark a text anywhere (even inside GGB) and then double ctrCC) the translation is better than that of google.
Thanks for ongoing discussion here.
Learning ideas and techniques from you both.
Thank you so much!
un intento poco testado
Thanks a lot mathmagic.
It works great.
I will still analyze your solution and try to understand the principle.
I intend to implement this code in this program (will take some time)
.
Best regards and thanks again
Raymond
he estado testando y creo que es necesario cambiar la definicion del punto B definiendo B=corner(5)+(2,2)
así, cuando la ventana grafica está en standar view la matriz GP vale {{50,0},{0,50}} que creo es lo correcto
trying setaxesratio(100,1)
I got strange numbers in matrix
I was thinking about this in the first work but I though it was rounding problem. 100:1 shows it is not a rounding problem
Comments have been locked on this page!