### Author Topic: Calculate Points Along Elliptical Arc  (Read 5348 times)

0 Members and 1 Guest are viewing this topic.

#### dpenny

• Newbie
• Posts: 6
##### Calculate Points Along Elliptical Arc
« on: March 20, 2015, 11:53:53 AM »
I need to calc a point on an elliptical arc in a standard visio shape so that I can add LineTo's onto the std. shape.
i.e., I need  y = f(x) where f is the std elliptical arc of a std visio shape, and I specify x.

Then I want to LineTo PNT(x,y).

I cant find any blog examples anywhere.

Thanks.
« Last Edit: March 20, 2015, 03:51:51 PM by Visio Guy »

#### wapperdude

• Global Moderator
• Hero Member
• Posts: 3799
• Ideas Visio-lized into solutions
##### Re: Calculate Points Along Elliptical Arc
« Reply #1 on: March 20, 2015, 01:09:22 PM »
What is it that you are ultimately trying to accomplish?  Sometimes the final objective suggests a variety of approaches.  For example, a balloon callout, a tangential line, a very specific, fixed point, etc, etc.
« Last Edit: March 20, 2015, 03:53:06 PM by Visio Guy »
Visio 2019 Pro

#### Visio Guy

• Hero Member
• Posts: 1712
• Smart Graphics for Visual People...n' Stuff
##### Re: Calculate Points Along Elliptical Arc
« Reply #2 on: March 20, 2015, 03:44:55 PM »
There is NEARESTPOINTONPATH for Visio 2010 and newer, which might help.

Or just use the standard algebra for the definition of an ellipse. If the elliptical arc is simply oriented. If it's at some angle or not an even half-ellipse, this doesn't help much:

y = +/- b * SQRT(1 - x^2/a^2)

where a is the x radius and b is the y radius of the ellipse. So that would break down to something like:

User.YofXforFullShapeEllipse = (Height*0.5)*SQRT(  1 - x^2/((Width*0.5)^2) )

You can also use circle math using x and y "radii" if you can use center and angle. But like wapperdude says, it might help to know what you're really trying to do.
« Last Edit: March 20, 2015, 03:52:56 PM by Visio Guy »
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

#### Nikolay

• Hero Member
• Posts: 931
##### Re: Calculate Points Along Elliptical Arc
« Reply #3 on: March 20, 2015, 04:37:23 PM »
Here is a related discussion about the "point on the path" which uses NEARESTPOINTONPATH and alike:
http://visguy.com/vgforum/index.php?topic=6279.msg25723#msg25723

This approach should also work for elliptical arc (see attached); but of course it all depends on what you are actually trying to accomplish.
I.e .it looks like you have posted here 2 messages, first one dated like 2 years ago, asking a very similar question.
It would be great if you could send a screenshot of what you are trying to do, or explain it somehow..

#### JuneTheSecond

• Hero Member
• Posts: 1027
##### Re: Calculate Points Along Elliptical Arc
« Reply #4 on: March 21, 2015, 06:08:48 AM »
Operation/Trim gives a crossing points.
1. Select a line and a ellipse.
2. Menu Operation/Trim cut the line and ellipse at crossing point.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

#### Nikolay

• Hero Member
• Posts: 931
##### Re: Calculate Points Along Elliptical Arc
« Reply #5 on: March 21, 2015, 07:57:55 AM »
I think we may be shooting in the dark
dpenny, could you probably provide more information on what you want to achieve? I.e. if you had this y = F(x) what would be your next step?
You are developing a shape in Visio, right? Could you tell us what the shape you are developing should look like, or how it should behave?

#### dpenny

• Newbie
• Posts: 6
##### Re: Calculate Points Along Elliptical Arc
« Reply #6 on: March 25, 2015, 05:24:49 PM »
Amazing - I actually got several cogent responses. (sorry, but I am really turned off to most of the SharePoint forums).

I am starting from the "document" shape on the "basic flow-chart stencil". It appears as vert line, horiz line, vert line, eliptic arc1, eliptic arc2, going counter-clockwise.

I am trying to add horiz lines spaced as I desire, tying into the two shape vert lines. This I can do.

I am also trying to add vert lines, spaced as I desire, tying for shape horiz line into the two eliptic arc segments.  This I cannot do.

I want the resulting shape ensemble to respond to stretching and/or rotation.
I plan to add text to the final shape in several locations.

PS. Have never worked with shapesheet before, but am quite good at VBA, Excel, jscript.

#### wapperdude

• Global Moderator
• Hero Member
• Posts: 3799
• Ideas Visio-lized into solutions
##### Re: Calculate Points Along Elliptical Arc
« Reply #7 on: March 25, 2015, 06:48:58 PM »
I think JuneTheSecond has a good , simple approach in mind...

Place your document sheet on the drawing.  Add your horizontal and vertical lines, overlapping the document shape.  Select all.  Then under shape operations > fragment.  The overlap ends should have vanished.  Now, with all of the desired shape pieces selected, shape operations > join.  You will have to re-fill the shape.

An optional step would be to group the "joined" shape.  That will clean up the appearance of the shape when it is selected.

HTH
Wapperdude
« Last Edit: March 25, 2015, 06:54:03 PM by wapperdude »
Visio 2019 Pro

#### dpenny

• Newbie
• Posts: 6
##### Re: Calculate Points Along Elliptical Arc
« Reply #8 on: March 27, 2015, 03:39:12 PM »
Thanks to all.

dPenny