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


Groups > comp.lang.postscript > #2497

Re: How long is a path? Alas currentdash is silent

From Scott Hemphill <hemphill@hemphills.net>
Newsgroups comp.lang.postscript
Subject Re: How long is a path? Alas currentdash is silent
References <7d687ea2-4b38-408d-be5f-e35d730137eb@googlegroups.com> <1regqufm4mopi$.y2znd2xxsk3k$.dlg@40tude.net> <c29bc460-0e9e-44ef-a259-9df1a6e33bac@googlegroups.com> <7f3d04a0-d6c3-4665-bae3-142f0c149284@googlegroups.com> <c50435f5-05ba-4793-b557-55dff3575a5e@googlegroups.com>
Date 2016-04-06 11:40 -0400
Message-ID <87y48qkanw.fsf@hemphills.net> (permalink)

Show all headers | View raw


jdaw1 <jdawiseman@gmail.com> writes:

> And in case it wasn't obvious, the length of a curve has to be
> approximated numerically as it doesn't integrate analytically. :-(
>
> Mathematica: 
>
>
> KnotsFromCoeffs[{c0_, c1_, c2_, c3_}] = {c0, c0 + c1/3, c0 + (2 c1 +
> c2)/3, c0 + c1 + c2 + c3};
> CoeffsFromKnots[{z0_, z1_, z2_, z3_}] = {z0, -3 z0 + 3 z1, 3 z0 - 6 z1
> + 3 z2, -z0 + 3 z1 - 3 z2 + z3};
>
> x = Table[t^i, {i, 0, 3}].CoeffsFromKnots[{x0, x1, x2, x3}];
> y = Table[t^i, {i, 0, 3}].CoeffsFromKnots[{y0, y1, y2, y3}];
>
> lengthPiece = Sqrt[Collect[D[x, t]^2 + D[y, t]^2, t]] // Simplify;
> Print[lengthPiece];
> length = Integrate[lengthPiece, {t, 0, 1}];
> Print[length];

Did you let the integration complete?  In my case, I just integrated

  Sqrt[a + b*t + c*t^2 + d*t^3 + e*t^4]

You get an answer in terms of square roots, trig functions, elliptic
integrals, and roots of the quartic.  But the roots of the quartic are
analytical.  So I'd say that it does integrate analytically.  However, it
is so messy, I'd rather approximate it numerically.

Scott
-- 
Scott Hemphill	hemphill@alumni.caltech.edu
"This isn't flying.  This is falling, with style."  -- Buzz Lightyear

Back to comp.lang.postscript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How long is a path? Alas currentdash is silent jdaw1 <jdawiseman@gmail.com> - 2016-04-05 16:34 -0700
  Re: How long is a path? Alas currentdash is silent tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2016-04-05 21:45 -0400
    Re: How long is a path? Alas currentdash is silent luser- -droog <mijoryx@yahoo.com> - 2016-04-05 19:09 -0700
      Re: How long is a path? Alas currentdash is silent jdaw1 <jdawiseman@gmail.com> - 2016-04-06 01:26 -0700
        Re: How long is a path? Alas currentdash is silent jdaw1 <jdawiseman@gmail.com> - 2016-04-06 05:07 -0700
          Re: How long is a path? Alas currentdash is silent Scott Hemphill <hemphill@hemphills.net> - 2016-04-06 11:40 -0400
            Re: How long is a path? Alas currentdash is silent jdaw1 <jdawiseman@gmail.com> - 2016-04-06 09:52 -0700
              Re: How long is a path? Alas currentdash is silent sjprouty3765@gmail.com - 2016-04-06 12:05 -0700
                Re: How long is a path? Alas currentdash is silent jdaw1 <jdawiseman@gmail.com> - 2016-04-06 14:55 -0700
              Re: How long is a path? Alas currentdash is silent Scott Hemphill <hemphill@hemphills.net> - 2016-04-06 17:12 -0400
                Re: How long is a path? Alas currentdash is silent jdaw1 <jdawiseman@gmail.com> - 2016-04-06 14:34 -0700
        Re: How long is a path? Alas currentdash is silent Scott Hemphill <hemphill@hemphills.net> - 2016-04-06 11:35 -0400
          Re: How long is a path? Alas currentdash is silent jdaw1 <jdawiseman@gmail.com> - 2016-04-06 09:38 -0700
  Re: How long is a path? Alas currentdash is silent jdaw1 <jdawiseman@gmail.com> - 2016-04-07 01:39 -0700
  Re: How long is a path? Alas currentdash is silent Carlos <angus@quovadis.com.ar> - 2016-04-08 15:04 +0200
    Re: How long is a path? Alas currentdash is silent jdaw1 <jdawiseman@gmail.com> - 2016-04-08 14:32 -0700
      Re: How long is a path? Alas currentdash is silent Carlos <angus@quovadis.com.ar> - 2016-04-09 01:19 +0200
    Re: How long is a path? Alas currentdash is silent jdaw1 <jdawiseman@gmail.com> - 2016-04-08 14:57 -0700
      Re: How long is a path? Alas currentdash is silent Carlos <angus@quovadis.com.ar> - 2016-04-09 01:31 +0200

csiph-web