View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T[_8_] Peter T[_8_] is offline
external usenet poster
 
Posts: 88
Default 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
radians with Excel's trig functions.

Peter T


 
ExcelBanter Database Error
Database Error Database error
The ExcelBanter database has encountered a problem.

Please try the following:
  • Load the page again by clicking the Refresh button in your web browser.
  • Open the www.excelbanter.com home page, then try to open another page.
  • Click the Back button to try another link.
The www.excelbanter.com forum technical staff have been notified of the error, though you may contact them if the problem persists.
 
We apologise for any inconvenience.