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

Math123 shared this question 2 years ago

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.

1

create the line m

then AttachCopyToView( m, 1 )

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 .

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))

1

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

x=2&&y<=2

Not working

1

I mean you must to use segment instead

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)

1

revise

it works for me version 5

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.

1

one possibility more

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.

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
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)

1

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

1

great trick

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

1

try:

A=PointIn(<absolut square>)

<relativeText> properties/position=A

and then create the corners of <relativeText>

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

1

Thanks

1

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