How can we draw fixed ray or line , no effect of zoom and moving axes(drag).

Math123 shared this question 3 years ago
Answered

How can draw fixed horizontal and vertical line and ray so that Axes movement( as we drag the axes position) and zooming does not change the position of line.

Comments (17)

photo
1

create the line m


then AttachCopyToView( m, 1 )

photo
1

Thanks mathmagic. It worked for line . How to do same for ray. It is not working for ray. i can draw horizontal ray from line by fixing domain by if[] command it worked. but for vertical ray i can not fixed domain. like line x=2 and i want ray between -5<= y <= 2 .

photo
1

I think it is a bug with ray. the command works for line and segment

meantime create two points A,B

C=AttachCopyToView( A, 1 )

D=AttachCopyToView( B, 1 )

then ray(C,D)


x=2&&-5<=y<=2 equal to segment((-5,2),(2,2))

photo
1

x=2&&-5<=y<=2

x=2&&y<=2

Not working

photo
1

I mean you must to use segment instead

photo
1

vertical ray not working it displace position when zoom and axes scale.

C=AttachCopyToView( A, 1 )

D=AttachCopyToView( B, 1 )

then ray(C,D)

photo
1

revise

it works for me version 5

photo
1

thanks it worked. with little bit changes. I draw point not on the ray slight up / down from the ray. It creates a ray slight up. Then i adjust the height of the original point.

photo
photo
1

one possibility more

photo
1

Pls see attached. When i draw line and ray separate it worked fine. But when i draw horizontal line and put a point on the line then draw horizontal ray with that point it did not work. It moves with zoom and axes.

photo
1

first attach all points then create the rest of structure


when the bug is fixed first create the line and ray then attach them

Files: foro.ggb
photo
photo
1

use absolut unit 1 (h and v), so the PathParameter of B and C are also absolut

Note: h and v are also the absolute zoom factor relative to standard-view, used when h and v was created (so not a indication in % from the last zoom)

photo
1

additional

"A" is a PointIn(<absolut square>) and can be moved AND is absolute.

photo
photo
1

great trick

this solve the question : how get corners of text for a text with "absolute position on screen"?

photo
1

try:

A=PointIn(<absolut square>)

<relativeText> properties/position=A

and then create the corners of <relativeText>

(instead of "move <relativeText>" move A)

photo
1

Thanks

photo
photo
1

Thanks, AttachCopyToView(ray,1) fixed for next release (v547)

© 2023 International GeoGebra Institute