Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16293 > unrolled thread

Re: Cubic Bezier Curves Intersection

Started byBob Hanlon <hanlonr357@gmail.com>
First post2013-11-30 07:24 +0000
Last post2013-11-30 07:24 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Cubic Bezier Curves Intersection Bob Hanlon <hanlonr357@gmail.com> - 2013-11-30 07:24 +0000

#16293 — Re: Cubic Bezier Curves Intersection

FromBob Hanlon <hanlonr357@gmail.com>
Date2013-11-30 07:24 +0000
SubjectRe: Cubic Bezier Curves Intersection
Message-ID<l7c3s8$cdc$1@smc.vnet.net>
pts1 = {{0, 0}, {1, 1}, {2, 0}, {3, 2}};


pts2 = {{1, 1}, {0, 0}, {3, 2}, {2, 0}};


Clear[f1, f2]


f1[x_] :=
  BezierFunction[pts1][x];


f2[x_] :=
  BezierFunction[pts2][x];


xip = NMinimize[{
    Norm[f1[x1] - f2[x2]],
    0 <= x1 <= 1, 0 <= x2 <= 1},
   {x1, x2}][[2]]


{x1 -> 0.700846, x2 -> 0.735816}


f1[x1] /. xip


{2.10254, 0.876654}


f2[x2] /. xip


{2.10254, 0.876654}


Show[
 Graphics[
  {Green, AbsolutePointSize[4], Point[pts1],
   Darker[Red], Point[f1[x1] /. xip]},
  Frame -> True],
 ParametricPlot[
  {f1[x], f2[x]}, {x, 0, 1}]]



Bob Hanlon




On Fri, Nov 29, 2013 at 3:49 AM, E. Martin-Serrano <
eMartinSerrano@telefonica.net> wrote:

> Hi,
>
> I would appreciate a  piece of Mathematica code implementing Cubic Bezier
> Curves Intersection.
>
> Any help either on the forum or  a notebook sent to the my  e-mail address
> will be welcome.
>
> Regards.
>
> E. Martin-Serrano
>
>
>
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web