Figuring an angle?

Das Goravani goravanis at
Sun Oct 10 18:32:43 UTC 2021

Dear $all,

Can anyone of you figure this out?

I want to know the Angle, in degrees 0 to 360, between two $objs on a thick window.

Picture this, the user drags an object, and when they let go the app figures out the angle between that dragged object and the center of a circle they were dragging over.. 

Now that I think about it, I think I’m out of luck because although you can drag fields by setting their drag property I don’t think there’s an event when they let go of the field.. and I doubt it’s location properties are set to where it was dragged to.. would have to have fields around the edge they could drag ONTO then we could know the location of what they dropped on. 

This is for astrology. I work in circles representing space around the earth. I would love to have drag and get angle so that I could then adjust things onscreen to how they dragged.. they could rotate things.. 

I think I’m out of luck.

If you have any ideas let me know.

As an alternative, it just occurred to me, that I think there are coordinates available for the location of the mouse pointer.. perhaps they could click a planet they want to drag, and instead of dragging they click the location they want it to go to.. I am given those coordinates by some mouse pointer thing Omnis has, and I work with that.. so given this, it seems I CAN know the location they want to “go to” and I know the center.. so the original question stands, can I know the ANGLE of those two by some trick of math?  Does any of you know how to get the angle from two objects or locations onscreen.. in pixels.. I imagine the tan() function might be involved. 

I do a lot of work like this kind of thing from another angle of approach.. like typical is I KNOW the angle, and I need to derive the pixels.. I have that wired.. got it from astronomy to computer books.. got a lot from those.. I rotate objects around the screen well.. but I’ve never approached this “selection of an angle” and THEN do something.. 

It just occurred to me that I could contantly move a line based on location of mouse pointer.. keep one end of the line on the center, move the other end to match the mouse tip, then I’d have an angled line when they let go.. don’t know if that would help me.. but it’s ends are what I want to derive the angle from. 

Any of you mathematicians?

Das Goravani

More information about the omnisdev-en mailing list