mariorancic
Topic Author
Posts: 23
Joined: 20 Jul 2019, 22:50

RotateTransform to rotate one existing Point around other

10 Dec 2021, 20:39

I am trying to rotate one existing point around the other and in WPF it is possible with method Transform of RotateTransform class
and for example I can do this:

RotateTransform rotation = new RotateTransform();
rotation.Angle = 45;
rotation.CenterX = p1.X;
rotation.CenterY = p1.Y;
p2 = rotation.Transform(p2);

but in NoesisGUI this method does not exist and what I can do instead.
 
User avatar
jsantos
Site Admin
Posts: 3925
Joined: 20 Jan 2012, 17:18
Contact:

Re: RotateTransform to rotate one existing Point around other

10 Dec 2021, 21:02

You can use Transform2::RotateAt(angle, centerX, centerY) in Noesis
 
mariorancic
Topic Author
Posts: 23
Joined: 20 Jul 2019, 22:50

Re: RotateTransform to rotate one existing Point around other

10 Dec 2021, 21:08

I am using NoesisGUI .net SDK and I do not see Transform2 class
Anyway, maybe with little help of Microsoft open sourced WPF, maybe I found answer on my own question:
Matrix matrix = new Matrix();
matrix.RotateAt(angle, centerX, centerY);
p2 = matrix.Transform(p2);

Maybe this will work, otherwise i have to somehow to get access to Transform2 class
 
User avatar
jsantos
Site Admin
Posts: 3925
Joined: 20 Jan 2012, 17:18
Contact:

Re: RotateTransform to rotate one existing Point around other

10 Dec 2021, 21:18

I see, your message was not marked with the tag C#, so I thought you were using C++.

Yes, that should work.
 
mariorancic
Topic Author
Posts: 23
Joined: 20 Jul 2019, 22:50

Re: RotateTransform to rotate one existing Point around other

10 Dec 2021, 23:40

thx

Who is online

Users browsing this forum: Google [Bot] and 53 guests