Correcting a segment's position for rotation

I have a segment I know the start and center point of start = (x,y), center = (y,z), I’m going to rotate said line about the center by angle a, this will cause the new start point to be at (x’,y’), I need to find the point (x’’,y’’) so that after the rotation, the start point will be (x,y).

This isn’t homework, by the way, I’m trying to work around some limitations in a framework I’m working with for some naive physics machine learning research.

I THINK x’’ = x-x’; y’’=y-y’, but I’m not sure of that, nor am I sure of how to compute x’ and y’ (I think it may involve the Law of Cosines).

Thanks

I can’t quite understand what you’re asking. Why are the first co-ordinate of the starting point and the second co-ordinate of the center point both necessarily equal (both are labelled y)? And what do you mean by “I need to find the point (x’’,y’’) so that after the rotation, the start point will be (x,y)”?

Hokay, see if I’ve got this right:

The original start point, the center point, and the new end point are on the three vertexes of a triangle with 2 equal sides, an isosceles triangle. The angle between the two equal sides is angle a. The other two angle are equal, = (180d - a)/2. Call them gamma.

The original start point and new end point can also be considered to be on an arc with a radius of the distance between the start point and the mid point. Given coordinates, the radius can be figured from the Pythagorean Formula. From trig, the chord length c = 2 * radius * sin(a/2).

The coordinate system angle between the original start point and the center point can be figured from their coordinates. The direction to the new start point can be figured by adding (but watch angle signs) gamma to the coordinate system angle. Use the chord length, the direction to the new start point, and a little more trig to find the delta x, delta y.

Details are left to the programmer.

Sounds like a job for vector math rather than messy trig and x,y coordinates.

(Missed edit window) Errata, 2nd paragraph:
The original start point and new start point…

I still have no idea what the actual question is…

Further clarification, 1st paragraph: The original start point, the center point, and the new start point…

Sheesh, maybe I should start over. But I won’t.

Yes, a little messy, but straightforward formulas, once figure out.

More or less. Let A be the rotation matrix corresponding to the angle a, and let c be the center. Rotation around c by a maps x to R(x - c) + c. If you want s = R(x - c) + c, then x = R[sup]-1[/sup](s - c) + c. Wikipedia gives the general form of a two dimensional rotation matrix.

OP: if you’re going to be doing any substantive research in machine learning, it pays to know basic geometry very well.

Dude wants his line segment to be the image of another segment under rotation around one of the endpoints.

Sorry, the Y coordinates aren’t the same. I’m on my phone, but I’ll post a pic once I get home.

What I’m asking is basically that in the system I’m working with you have to rotate about the center, but you position by the leftmost point (for simplicity). So if I want to position a rotated object I have to place it at a point other than where I want it and then then rotate it into the desired point, since rotation occurs after positioning.

Oh. Then… just rotate by the same angle in the other direction? Is that all they’re looking for?

Alternatively, letting p = (x, y) be the original point, and p’ = (x’, y’) be the point you get by rotating (x, y) around c by the angle a in one direction, and p’’ = (x’’, y’’) be the point you get by rotating (x, y) around c by the angle a in the other direction, then to find p’’ from p, p’, and c (without necessarily knowing a), just mirror p’ across the line from p to c.

No, I’m saying take some segment that starts at, say, (0,0), I rotate it about the center and now it starts at, say, (1,-1). I want that same rotated segment, except starting at (0,0).

Geometry was always my weak suit (algebra and calculus were my better ones), and would you believe that through two linear algebra courses they never went over transformation matrices for more than 10 minutes? But transformations seem to be rather simple, so I’ll just go with that, thanks.

ETA: I also haven’t had to deal with geometry in over 5 years, I’ll brush up. Sorry for being stupid.

It’s nothing you have to apologize for, but you’re going to find this kind of stuff to be invaluable time and time again, so it’s worth putting in some time to learn.