In this post, we will see how to resolve Rotate point around another point. COS / SIN not working? Question: So, my goal is to rotate one point around another point, which shouldn’t be hard. I found some code answers ...

In this post, we will see how to resolve Calculating the 2D turn movement required given an incoming and outgoing direction Question: Consider a 2D square tiled grid (chess board like) which contains conveyor belt like structures that can curve ...

In this post, we will see how to resolve How do you calculate the x,y points of all corners of a square from two only a pair of x,y points (see pic) Question: I have the green x,y points, how ...

In this post, we will see how to resolve How to move a robot arm in a circle Question: I have a 6 joint robot arm, and I want to move it in a circle. I want parameters to choose ...

In this post, we will see how to resolve Numerically stable way to compute (x-sin(x))/x^3 Question: I’m looking for a very fast way to compute (x-sin(x))/(x^3) for all x using IEEE floating point arithmetic and standard trigonometric functions. At 0, ...

Question: I am writing a simple program to calculate the phases of the moon; I use the algorithms presented in Jean Meeus’ book “Astronomical algorithms” 2nd edition. On p. 350 (chapter 49) he writes: Calculate […] the following angles, which ...

Question: I want to use the PI constant and trigonometric functions in some C++ program. I get the trigonometric functions with include <math.h>. However, there doesn’t seem to be a definition for PI in this header file. How can I ...

Question: I’m given an array of points for a rectangle, sorted from top-left position onwards to each corner clockwise. I need to find the start and end points for a line of each specific corner length from the corner to ...

Question: I have a point in 3D space, and that point has an orientation. I want to get the end point of a line X distance from the origin point, following in orientation. How would I do this? The answer ...

Question: I have polylines in an Oracle 18c table. Using SQL, I want to determine what the “change in angle” is from point to point. Question: How can I calculate the angles between points? In other words, given a line ...