Calculate Points Along Elliptical Arc

Started by dpenny, March 20, 2015, 04:53:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dpenny

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.

wapperdude

#1
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.
Visio 2019 Pro

Visio Guy

#2
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.
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

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

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

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

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.

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

wapperdude

#7
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
Visio 2019 Pro

dpenny