Re: Identifying Last Point Preceding Last Vertical Tangent in a Data Set
- From: monir <monirg@xxxxxxxxxxxx>
- Date: Thu, 10 Apr 2008 19:10:46 -0700 (PDT)
On Apr 8, 11:07 am, monir <mon...@xxxxxxxxxxxx> wrote:
On Apr 8, 5:25 am, spellu...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (Peter
Spellucci) wrote:
In article <41cceb0d-5d72-48d1-ba62-43a5ba426...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, monir <mon...@xxxxxxxxxxxx> writes:
>Hello;
>
>The title maybe a bit confusing and the question may not even belong
>to this Newsgroup, but I'll go ahead with posting anyway expecting a
>feedback either way!
>
>1) I've a number of data sets (in the 100s), each set consists of N
>analytically derived data points P(x,y) sequentially numbered 1, 2,
>3, ..., N.
>
>2) The data points per set appear at a first to be randomly
>distributed, however a closer look would reveal that the first few
>points are clustered in such a way resembling a rotational pattern.
>In other words, if one joins the points by straight-line segments: P1-
>P2, P2-P3, P3-P4, etc., one can easily see a rotational pattern
>developing (in a clockwise direction starting at point 1) before the
>rotation dissipates as the pattern flattens out approaching the outer
>points.
>
>3) All relevant points are in the 2nd quarter (i.e.; -ve X and +ve Y).
>
>4) In my algorithm, I would like to identify (in a DO loop for each
>data set, and with a reasonable level of confidence!) the index of the
>point that is "most likely" be the LAST point preceding the LAST
>vertical tangent. (Again, assuming it's a clockwise non-self-
>intersecting smooth curve starting at P1).
>
>5) Identifying the index +/- 1 would probably be good enough for the
>task. (Hard to tell. It depends!!)
>
>6) I've tried a couple of ideas so far with no success.
>
>a- The first approach considers the angle between each successive 2
>vectors. For example, if the angle between V21 and V23 is less than,
>say, pi/2 (an arbitrarily-chosen angle) then P2 (i.e.; index=2) is
>temporarily the last point. Repeat for V32 and V34, and update the
>index to 3 if the angle at P3 is < pi/2, and so on. Didn't work!!!
>
>b- The second approach joins points P1, P2, P3 by a circle with centre
>at C(h,k), and saves the highest index of the point that satisfies:
>x < h and y < k
>Repeats for P2, P3, P4 and updates the index as applicable. Didn't
>work!!!
>
>7) I would be glad to post a couple of sample 8-point data sets to
>avoid possible confusion or misunderstanding. This data could be used
>also for validation purposes of whatever idea/numerical method one
>could come up with. By plotting the sample data, one could visually
>identify the LAST point likely to precede the LAST vertical tangent
>for the data set. Such points would be clearly marked in the sample
>numerical tables.
>(In real life, however, interrupting the algorithm, plotting each of
>the 100s data sets, visually identify the point index and then
>continue would be impractical to say the least and it's not an
>option!)
>
>Any suggestions ?? Thank you kindly.
>Monir
your data are P(i)=(x(i),y(i)) i=1,...,N
_ o r d e r f i x e d a n d g i v e n ??? _
and
you mean something like a spiral , and "flattens out" means that it
ends in a tail which can be represented by a function y(i)=f(x(i) )?
then do the following:
first compute the arclength of the piecewise linear arc connecting the
points:
t(1)=0
t(i+1)=t(i)+sqrt((x(i)-x(i-1))^2+(y(i)-y(i-1))^2) i=1,...,N-1
next compute _two independent_ splines under tension
s1 : s1 interpolates (t(i),x(i)) i=1,..,N
s2 : s2 interpolates (t(i),y(i)) i=1,..,N
chose the tension parameter such that the curve
x=s1(t)
y=s2(t) 0<=t<=t(N)
is not self intersecting.
now you have a smooth curve interpolating your data which should pretty
look like what you expect.
the tnagent vector is
(s1'(t),s2'(t))
(not normalized, but this is irrelevant here)
now, going down from t(N) to 0 , search for the first zero of s1' (t)
from the right: s1'(t)=0 means a "vertical" tangent.
(x=horizontal and y=vertical axis)
take the "next" point of the data set.
done
software for tension spline:
http://www.netlib.org/toms ;
toms/716
title: tspack
ref: TOMS 19,1
for: tension spline curve-fitting package
by: Renka
gams: e1a, e1c, k1a1a1, k1a1a3
size: 252 kB
Score: 100%
hth
peter
Hi Peter;
Thank you for your suggestion. Will shortly review the tension spline
package to see if it could be reasonably implemented.
In the meantime, here're some simplified data sets.
(none) Spiral1.........Spiral2
p# x y p# x y
1 -3.30 7.47 *1 -3.84 7.00
2 -3.07 7.71 2 -3.94 7.38
3 -2.59 6.90 3 -2.97 6.60
4 -2.12 6.09 4 -2.33 5.44
5 -1.61 5.01 5 -2.00 4.56
6 -1.13 3.87 6 -1.60 3.53
7 -0.69 2.39 7 -1.28 2.36
8 -0.38 1.03 8 -1.05 1.15
.......Spiral3..........Spiral4
p# x y p# x y
1 -4.28 6.45 1 -6.45 5.37
*2 -4.58 6.09 2 -6.25 5.75
3 -4.71 6.95 *3 -5.53 5.30
4 -3.30 5.96 4 -6.17 6.40
5 -2.66 4.54 5 -4.94 5.80
6 -2.15 3.29 6 -3.60 4.08
7 -1.89 2.34 7 -2.94 2.44
8 -1.72 1.20 8 -2.71 1.46
.......Spiral5...........Spiral6
p# x y p# x y
1 -8.01 4.31 1 -10.29 3.30
2 -8.27 4.55 2 -10.93 3.16
3 -7.76 4.83 3 -10.47 3.91
*4 -7.27 4.26 4 -9.34 3.56
5 -8.63 5.14 5 -10.14 2.43
6 -7.63 5.96 *6 -11.67 2.76
7 -6.00 4.45 7 -11.47 4.15
8 -5.09 2.70 8 -10.26 4.76
9 -4.66 1.38 9 -9.16 4.50
.................10 -8.20 3.27
.................11 -7.19 0.80
Visual examination of the relevant display would reasonably suggest
that the points marked "*" in the above numerical tables are the LAST
points preceding the LAST vertical tangents in each data set. (Spiral1
has none.)
Any comments ??
Regards.
Monir- Hide quoted text -
- Show quoted text -
.
- References:
- Prev by Date: Re: iterative vs. direct methods for linear systems
- Next by Date: Re: all solutions team
- Previous by thread: Re: Identifying Last Point Preceding Last Vertical Tangent in a Data Set
- Next by thread: Does Allah create us in vain?
- Index(es):
Relevant Pages
|