Find the other point with distance and angle in LISP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I'm trying to do a function that calculates a point from a point of origin, an angle and a distance, and draw a line between the two points.
So, I know I can calculate the distance with something like "distance = sqrt ((x1 - x2) ^ 2 + (y1 - y2) ^ 2)" (it would not be that well in LISP, but to simplify it is something like this) or I could get the two points (pt1 and pt2) and do (list (distance pt1 pt2)) and could get in the angle this way: (list (angle pt1 pt2)). But taking into account that the information I'm going to get will only be a point, the angle and distance between that point and what I'm going to calculate, I wonder if I would have to use the "ready-made" functions I've already shown or I would have to do it some other way.
I'm starting in LISP and really are many things in one program and I'm trying to develop the best way possible.