News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Shape Help - Change the orientation of Zero Degrees

Started by zhollett, March 17, 2010, 05:19:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zhollett

Hi, I hope this is in the right place and Thanks for any assistance.

What I am attempting to do is change the orientation of a shape so that Zero Degrees (0º) is in the 9 o'clock position instead of the 12 o'clock position.

The reason I am doing this is because I want to create a Tachometer object and the center arrow is going to be the pointer.

Right now, if the input is at say 30% of full speed, I am having troubles getting the arrow to sit at the proper angle.

The reason is that 30% of full speed *should* be easy to calculate as in 30% of 180º but because the orientation of the shape has 0º at the top 12 o'clock position and progressing thru degrees of rotation is to the left (anti-clockwise) it becomes really difficult to calculate the math.

The same situation is if the input is at 76% of full speed.  That side of the Tachometer (from 50% to 100%) uses angles 360º to 270º.

Its really confusing to me.

So, to make things easier for me, I would like to change the orientation of the object so that 0º sits in the 9 o'clock position and then have the degrees of rotation move in the clockwise position.

I'm sorry if this sounds a bit confusing.

Notes:
1. 0º is at the top of the shape or the 12 o'clock position
2. Going through positive angle progression occurs in the anti-clockwise direction
3. I want 0º to be at the 9 o'clock position
4. I want positive angle progression to happen in the clockwise direction

wapperdude

To move the position of the "0 deg" there are two possibilities for your arrow. 
  1>  If it is a custom shape, redraw it with the correct orientation.
  2>  If that is not an option, then, you can add a fixed offset to the angle. 

To change the direction of rotation, multiply your value by "-1".

To correct split angle thing, use the function ang360(your value).  See http://msdn.microsoft.com/en-us/library/ms406637.aspx

I've attached an example to pull of this together...
Visio 2019 Pro

zhollett

Thanks Wapperdude.

I went with the ANG360 option and it worked perfectly.

I appreciate your quick (and correct) responses.

You are an asset to this forum.

Take care
Zach

wapperdude

Hey Zach --

Thanks for the kind words!   ;D 

Glad everything worked out.

Wapperdude
Visio 2019 Pro

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 190 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1055KB.
Tokens: post-login.
Cache hits: 13: 0.00218s for 26,723 bytes (show)
Cache misses: 3: (show)
Queries used: 17.

[Show Queries]