clone pointB as pointC
make a rotation transformation [tr] about pointA using the Z_AXIS and the desired angle
pointC.transform!(tr)
repeat for pointD with a negative rotation angle.
If you want an ‘offset’ dimension rather than an angle, you can get the flat-radius using Pythag.
Using the flat-radius and desired ‘offset’ you can get the angle for the transformation rotation, OR calculate the new point directly…
Although you could try some basic 2D trigonometry, I would recommend using 3D transformations instead. Point A can be projected onto the X-Y plane as point E. Since it is the main X-Y plane through the origin, its coordinates would be <A.x, B.y, and zero>. Given A and B as Point3d variables “point_A” and “point_B”, expanding upon what @TIG said:
@BruceYoung
I don’t think you need to project point_A onto the ground.
So then you don’t need point_E, because the rotation is around a vector [Z_AXIS] and any point sets the rotation’s transformation around itself using that vector - so point_A works fine as it is.
Otherwise your code is fine…
Since the OP didn’t specify the actual angle through which to rotate the new two points [or how else we might determine the two points’ locations], your idea to take the default circle segmentation at 360/24.0 seems OK for now…
But if the ‘offset’ of the points is a fixed distance from point_B then your earlier approach to project point_A onto the ‘ground’ could be adjusted to take account of point_B’s z value: