Remember Me?

#1
October 6th 20, 04:52 AM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Sep 2020 Posts: 9
Coordinates of a grouped line

In code I draw 2 identical vertical lines (the end of one line is the start of the next). The lines are then grouped to form a grouped shape that is twice the length of the individual lines. I then rotate the shape a set number of degrees. How do I determine the new coordinates of the bottom end of the rotated shape. Using .left and .top etc. all give me the position of the shape before rotation. Is there a parameter which describes the new position?

David

#2
October 7th 20, 12:15 PM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Jul 2019 Posts: 64
Coordinates of a grouped line

"David Cuthill" wrote in message
In code I draw 2 identical vertical lines (the end of one line is the start
of the next). The lines are then grouped to form a grouped shape that is
twice the length of the individual lines. I then rotate the shape a set
number of degrees. How do I determine the new coordinates of the bottom end
of the rotated shape. Using .left and .top etc. all give me the position of
the shape before rotation. Is there a parameter which describes the new
position?

David

==========

The Shape object as a Rotation property which returns degrees about the
centre of the shape, in your case the point where the two lines join.

Your shape will include two GroupItems, ie your line objects. Get the XY end
points of the lines from the opposite diagonals of the left/top/ht/wd
values. One point will be the centre, the other the point on the circle.

Use the rotation value with a bit of trigonometry to calculate the new
virtual positions of the lines. Don't forget degrees need to be converted to

Peter T

#3
October 7th 20, 04:31 PM posted to microsoft.public.excel.programming
 external usenet poster First recorded activity by ExcelBanter: Sep 2020 Posts: 9
Coordinates of a grouped line

Thanks Peter
I have got something to work based on your suggestions.

 Posting Rules Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On

 Similar Threads Thread Thread Starter Forum Replies Last Post Smylegirl Charts and Charting in Excel 12 May 2nd 07 10:08 PM Zone[_2_] Excel Programming 3 January 26th 07 01:02 PM Zorro[_3_] Excel Programming 1 June 1st 06 03:26 AM Dan[_38_] Excel Programming 8 July 11th 04 04:54 PM Steve[_50_] Excel Programming 3 December 2nd 03 07:48 PM

All times are GMT +1. The time now is 02:54 PM.