POV-Ray : Newsgroups : povray.advanced-users : an analytic geometry question Server Time
5 Jul 2024 15:48:28 EDT (-0400)
  an analytic geometry question (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: honnza
Subject: an analytic geometry question
Date: 6 Oct 2007 07:35:00
Message: <web.4707726d501959fba9ce4df50@news.povray.org>
Is there an easy way to join two points by two circular arcs given their
tangents?
Input:
A,B - endpoints
a,b - their tangents (oriented parallel to the arcs)
where A+at and B+bs are skew lines (it's easy to handle the planar case)
Output:
C,D - arc centers
arc normals and radii can be calculated easily from these
E - intersection point of both points
together with the arcs' common tangent vector it will be used to cut the
tori.

I think (after some analysing) it has an infinite number of solutions,
parametrised by a real number.


Post a reply to this message

From: Matt Denham
Subject: Re: an analytic geometry question
Date: 6 Oct 2007 17:00:01
Message: <web.4707f693e98c81e715a330d40@news.povray.org>
"honnza" <jan### [at] centrumcz> wrote:
> Is there an easy way to join two points by two circular arcs given their
> tangents?
> Input:
> A,B - endpoints
> a,b - their tangents (oriented parallel to the arcs)
> where A+at and B+bs are skew lines (it's easy to handle the planar case)
> Output:
> C,D - arc centers
> arc normals and radii can be calculated easily from these
> E - intersection point of both points
> together with the arcs' common tangent vector it will be used to cut the
> tori.
>
> I think (after some analysing) it has an infinite number of solutions,
> parametrised by a real number.

Let me make sure I'm understanding this correctly.

Basically, what you want is, given the two lines and two points, to define
what turns out to be a "twisted" plane (an infinite helical surface - if
you take a line perpendicular to both tangents, and use that as the axis of
a cylinder, you get a helical curve where the resultant surface produced by
the lines intersects the cylinder), and then...

....yeah, that's not gonna be easy at all.  I'm not entirely sure even what
the formula for the surface in question is, though I could probably figure
it out given a couple of hours and access to a copy of, say, Mathematica.


Post a reply to this message

From: andrel
Subject: Re: an analytic geometry question
Date: 6 Oct 2007 18:26:35
Message: <47080C9D.1030407@hotmail.com>
honnza wrote:
> Is there an easy way to join two points by two circular arcs given their
> tangents?
> Input:
> A,B - endpoints
> a,b - their tangents (oriented parallel to the arcs)
> where A+at and B+bs are skew lines (it's easy to handle the planar case)
> Output:
> C,D - arc centers
> arc normals and radii can be calculated easily from these
> E - intersection point of both points
> together with the arcs' common tangent vector it will be used to cut the
> tori.
> 
> I think (after some analysing) it has an infinite number of solutions,
> parametrised by a real number.
> 
> 
Make a scetch of what you want. My tentative answer would be: no.
counter example A=(0,0), a=(1,1), B=(1,0), b=(1,1).
But that might be because I don't understand your question.

I also have problems with E: an intersection point of points??


Post a reply to this message

From: honnza
Subject: Re: an analytic geometry question
Date: 7 Oct 2007 02:40:00
Message: <web.47087bb0e98c81e7a9ce4df50@news.povray.org>
"Matt Denham" <mde### [at] bemanirebirthnet> wrote:
> "honnza" <jan### [at] centrumcz> wrote:
> > Is there an easy way to join two points by two circular arcs given their
> > tangents?
> > Input:
> > A,B - endpoints
> > a,b - their tangents (oriented parallel to the arcs)
> > where A+at and B+bs are skew lines (it's easy to handle the planar case)
> > Output:
> > C,D - arc centers
> > arc normals and radii can be calculated easily from these
> > E - intersection point of both points
> > together with the arcs' common tangent vector it will be used to cut the
> > tori.
> >
> > I think (after some analysing) it has an infinite number of solutions,
> > parametrised by a real number.
>
> Let me make sure I'm understanding this correctly.
>
> Basically, what you want is, given the two lines and two points, to define
> what turns out to be a "twisted" plane (an infinite helical surface - if
> you take a line perpendicular to both tangents, and use that as the axis of
> a cylinder, you get a helical curve where the resultant surface produced by
> the lines intersects the cylinder), and then...
>
> ....yeah, that's not gonna be easy at all.  I'm not entirely sure even what
> the formula for the surface in question is, though I could probably figure
> it out given a couple of hours and access to a copy of, say, Mathematica.

No. I want to make a tube out of two torus segments when I know where it
starts (A) and in which direction (a) and where it ends (B) and in which
direction (b). If the lines that touch them (A+at and B+bt) are parallel or
intersect it's a planar case and will be solved with a torus and a cylinder
(might need to handle some unprobable cases seperately). It's easy to find
a circle given two tangents and a point on one of them, then find the other
intersection point and choosing the correct arc. A bit more complicated is
which point should be the one with a cylinder on its end (I already see a
case where I need two tori - maybe even half of the planar input space -
represented by two antiparallel tangents).
What I'm asking here is a general solution (or a hint) to the spatial case.
I've  already found out that just by choosing two arc normals (normals to
the planes that contain the arcs) I parametrise the set of arc-line
segment-arc solutions. The problem is it's hard to calculate the line
segment length which I would then equate to zero (I might retry working
this way, solving the planar case first). I'm expecting a 1-dimensional set
of solutions, which might be tough to select from, depending on the measure
of wellness (total length of the arcs? one of the curvatures?
almost-symmetry preservation (whatever it is) so that it doesn't behave
erraticaly around the planar case?) but I will try to do this part by
myself.


Post a reply to this message

From: Le Forgeron
Subject: Re: an analytic geometry question
Date: 7 Oct 2007 03:14:52
Message: <4708876c@news.povray.org>
Le 06.10.2007 13:33, honnza nous fit lire :
> Is there an easy way to join two points by two circular arcs given their
> tangents?
> Input:
> A,B - endpoints
> a,b - their tangents (oriented parallel to the arcs)
> where A+at and B+bs are skew lines (it's easy to handle the planar case)
> Output:
> C,D - arc centers
> arc normals and radii can be calculated easily from these
> E - intersection point of both points
> together with the arcs' common tangent vector it will be used to cut the
> tori.
> 
> I think (after some analysing) it has an infinite number of solutions,
> parametrised by a real number.
> 
> 
Do you also want continuity in E (intersection of both arcs): same
tangent direction  ?

restricting analysis to 2D, I already have a puzzle with
 A: <0,0>
 B: <1,0>
 a: <0,1>
 b: <-1, 0>

Where are C and D ?

Even stranger, the basic:
A: <0,0>
B: <1,0>
a: <0,1>
b: <0,1>

An obvious single arc (centered at <0.5,0>), but how to do that with
2 (short of degenerated solution like twice the same center) ?


Back in 3D, two points and 1 tangent might define a plane (excepted
when tangent is colinear to delta of the points). Remains the
question: is the second tangent in the same plane or not.
If yes, a 2D solution is enough.
If no, is there a solution ?

-- 
The superior man understands what is right;
the inferior man understands what will sell.
-- Confucius


Post a reply to this message

From: honnza
Subject: Re: an analytic geometry question
Date: 7 Oct 2007 10:00:00
Message: <web.4708e532e98c81e7a9ce4df50@news.povray.org>
Le Forgeron <jgr### [at] freefr> wrote:
> Le 06.10.2007 13:33, honnza nous fit lire :
> > Is there an easy way to join two points by two circular arcs given their
> > tangents?
> > Input:
> > A,B - endpoints
> > a,b - their tangents (oriented parallel to the arcs)
> > where A+at and B+bs are skew lines (it's easy to handle the planar case)
> > Output:
> > C,D - arc centers
> > arc normals and radii can be calculated easily from these
> > E - intersection point of both points
> > together with the arcs' common tangent vector it will be used to cut the
> > tori.
> >
> > I think (after some analysing) it has an infinite number of solutions,
> > parametrised by a real number.
> >
> >
> Do you also want continuity in E (intersection of both arcs): same
> tangent direction  ?
>
exactly.
>
> restricting analysis to 2D, I already have a puzzle with
>  A: <0,0>
>  B: <1,0>
>  a: <0,1>
>  b: <-1, 0>
>
> Where are C and D ?
>
There is an infinite number of two-arc solutions, with C=(1/4,0),D=(3/4,0)
being the most symmetric one. Thanks for pointing out.
>
> Even stranger, the basic:
> A: <0,0>
> B: <1,0>
> a: <0,1>
> b: <0,1>
>
>
> An obvious single arc (centered at <0.5,0>), but how to do that with
> 2 (short of degenerated solution like twice the same center) ?
>
the arc solution is a special case of the arc-line solution, the line
segment being zero. Having two non-degenerate arcs isn't neccesary, and
it's a common practice to allow degenerate solutions for special cases.
e.g. circle inversion sends circles to circles and three points always
define a circle, considering lines being degenerate circles.

The basic solution is to take a circle tangent to both lines at one of the
points, and joining the other point by a linear segment (a degenerate arc).
However, it fails in half of the cases (or it generates a solution that
crosses the infinity).
>
> Back in 3D, two points and 1 tangent might define a plane (excepted
> when tangent is colinear to delta of the points). Remains the
> question: is the second tangent in the same plane or not.
> If yes, a 2D solution is enough.
> If no, is there a solution ?
>
It's not in the same plane. I already consider this a planar case. By "skew"
I understand "not parallel and not intersecting".
I believe there's always a solution, even infinitude of them.
>
> --
> The superior man understands what is right;
> the inferior man understands what will sell.
> -- Confucius


Post a reply to this message

From: Alain
Subject: Re: an analytic geometry question
Date: 7 Oct 2007 15:27:19
Message: <47093317$1@news.povray.org>
honnza nous apporta ses lumieres en ce 2007/10/06 07:33:
> Is there an easy way to join two points by two circular arcs given their
> tangents?
> Input:
> A,B - endpoints
> a,b - their tangents (oriented parallel to the arcs)
> where A+at and B+bs are skew lines (it's easy to handle the planar case)
> Output:
> C,D - arc centers
> arc normals and radii can be calculated easily from these
> E - intersection point of both points
> together with the arcs' common tangent vector it will be used to cut the
> tori.
> 
> I think (after some analysing) it has an infinite number of solutions,
> parametrised by a real number.
> 
> 
You may try the ik neck macro by Rune S. Johansen. It takes 2 arbitrary end 
points, 2 arbitrary directions (your tangents), a weighting/rigidity value for 
both direction and a total development distance.
It returns a spline that you can use to place several spheres or other objects, 
or as control points for a sphere_sweep.
The file name is: ikn.inc. It's heavily commented, helping the comprehention of 
the technique utilised.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when someone shows you a photograph of 
their new rough-slate kitchen floor and you say "nice normals".
     -- Tom Melly


Post a reply to this message

From: Penelope20k
Subject: Re: an analytic geometry question
Date: 8 Oct 2007 05:01:48
Message: <4709f1fc$1@news.povray.org>
Well simple

Found the intersection of the 2 tangent
if none .. then the arc is an half circle of R=1/2 [AB] with center at the
middle

if one intersection . (says I)
for an circular arc exist between A and B then both lengt IA and IB must be
equal.. if not, a curve can exist but not a circular curve ...


To found the center ( says O) you must have
IO perpendicular to AB
and have the following rule





If 2 point of intersection , ...well your are under a sphere ...







web.4707726d501959fba9ce4df50@news.povray.org...
> Is there an easy way to join two points by two circular arcs given their
> tangents?
> Input:
> A,B - endpoints
> a,b - their tangents (oriented parallel to the arcs)
> where A+at and B+bs are skew lines (it's easy to handle the planar case)
> Output:
> C,D - arc centers
> arc normals and radii can be calculated easily from these
> E - intersection point of both points
> together with the arcs' common tangent vector it will be used to cut the
> tori.
>
> I think (after some analysing) it has an infinite number of solutions,
> parametrised by a real number.
>
>


Post a reply to this message

From: Mark Weyer
Subject: Re: an analytic geometry question
Date: 10 Oct 2007 04:55:00
Message: <web.470c90f7e98c81e7fddaa4670@news.povray.org>
"honnza" <jan### [at] centrumcz> wrote:
> Is there an easy way to join two points by two circular arcs given their
> tangents?
> Input:
> A,B - endpoints
> a,b - their tangents (oriented parallel to the arcs)
> where A+at and B+bs are skew lines (it's easy to handle the planar case)
> Output:
> C,D - arc centers
> arc normals and radii can be calculated easily from these
> E - intersection point of both points
> together with the arcs' common tangent vector it will be used to cut the
> tori.
>
> I think (after some analysing) it has an infinite number of solutions,
> parametrised by a real number.

I will ignore all degenerate cases in the following.

It suffices to know E. From there it is just getting an arc from the
endpoints and a tangent at one endpoint in a plane (two times of course).

To any given point E there are of course unique arcs from A and B with
tangents a and b. In general, though, the other tangents at E will not
meet. So given A,a, and E, what is the tangent at E of the joining arc? It
is the tangent a, mirrored at the plane perpendicular to the line AE. That
is  a-2*<a,E-A>/<E-A,E-A>*(E-A) where <v,w> is the dot product. So we are
looking for E such that
  a-2*<a,E-A>/<E-A,E-A>*(E-A) and
  b-2*<b,E-B>/<E-B,E-B>*(E-B)
are colinear. We can assume without loss of generality that a and b have
unit length. Then the mirrored vectors also have unit length and we can
replace colinearity with equality (up to different sign). Hence we want
to solve to vector equation
  a+b = 2*<a,E-A>/<E-A,E-A>*(E-A)+2*<b,E-B>/<E-B,E-B>*(E-B)
In the coordinates x,y,z of E, this is a system of three equations.
Multiplying be the common denominator <E-A,E-A>*<E-B,E-B> all three
equations become polynomials of degree 4.

To me it seems that those are rather general systems of equations, so I
doubt that you have an infinitude of solutions.

For solving this system of equations I would recommend numerical methods.



Of course, degree-4 polynomials can be solved exactly using radicals. So
you can solve one equation, obtaining a solution for one variable in terms
of the other two. Plugging this solution into the other equations just
might give you some simplification. But I would not bet in your favor.

If you are still sure that you have a continuum of solutions, then you can
eliminate one degree by forcing <E-A,E-A>=<E-B,E-B>. Geometrically this
means that the point E has the same distance from A and B, which is maybe
not an esthetically bad way to choose among the possibilities. It adds one
more equation, this time a polynomial of degree 2. It has the benefit that
for turning the other equations into polynomials it suffices to multiply
by <E-A,E-A>, yielding polynomials of degree just 2.

Hope this helps,

  Mark Weyer


Post a reply to this message

From: honnza
Subject: Re: an analytic geometry question
Date: 20 Oct 2007 09:40:00
Message: <web.471a04d4e98c81e7a9ce4df50@news.povray.org>
> It suffices to know E. From there it is just getting an arc from the
> endpoints and a tangent at one endpoint in a plane (two times of course).
>
> ....
>
> If you are still sure that you have a continuum of solutions, then you can
> eliminate one degree by forcing <E-A,E-A>=<E-B,E-B>. Geometrically this
> means that the point E has the same distance from A and B, which is maybe
> not an esthetically bad way to choose among the possibilities. It adds one
> more equation, this time a polynomial of degree 2. It has the benefit that
> for turning the other equations into polynomials it suffices to multiply
> by <E-A,E-A>, yielding polynomials of degree just 2.
>
> Hope this helps,
>
>   Mark Weyer

Thanks a lot for your answer. Meanwhile I had a similar idea of
parametrising by their common tangent direction (the position can be
calculated as a plane-plane intersection) and comparing the corresponding
tangent points. This yiels one equation for two degrees of freedom, thus
creating the continuum.
Also, I might use your idea of selecting the solution.


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.