# Data Points Joined by Spiral

#### monirg

##### Well-known Member
Hello;

I've non-monotonic analytically derived data points: (x,y)i, i=1, n
I would like to join the points by a smooth curve with the following constraints:
a. points are joined in the same order, i.e.; pnt# 1, pnt# 2, ..., pnt# N
b. the curve progresses in clockwise direction ONLY starting at pnt # 1
c. the curve does not cross itself
d. the curve has a minimum possible turns
e. the curve has a known (dy/dx) at pnt # n

By examining the data, the points appear to lie on a spiral of some kind.

Here're two sets of data points for illustration purposes
(Ref. HTK006,T*=0.08,T*=0.05):
SET # 1:
n = 5, (dy/dx) at pnt# 5 = - 4.1343
pnt#1 x = - 0.2062 , y = 0.9369
pnt#2 x = - 0.1937 , y = 0.9454
pnt#3 x = - 0.2043 , y = 0.9263
pnt#4 x = - 0.1797 , y = 0.9640
pnt#5 x = - 0.1542 , y = 0.9309

SET # 2:
n = 4, (dy/dx) at pnt# 4 = - 8.6897
pnt#1 x = - 0.1206 , y = 0.9698
pnt#2 x = - 0.1292 , y = 0.9470
pnt#3 x = - 0.1282 , y = 0.9785
pnt#4 x = - 0.0974 , y = 0.9508

(n=3 and n=10 are generally the min and max data points per set)

How can one develop such spiral ???

Your expert opinion would be greatly appreciated.

### Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the \$ sign).

#### Damon Ostrander

##### MrExcel MVP
Hi Monir,

I don't know if this is what you are after, but perhaps you will at least find it interesting and can perhaps glean some ideas:

Code:
``````Sub DrawSpiral()
'
' Written 1/14/99 by Damon Ostrander
'
Const A = 5
Const B = 1#
Const TwoPi = 2 * 3.1415926535
Const nRevs = 4

Dim x0      As Single
Dim y0      As Single
Dim x       As Single
Dim y       As Single
Dim R       As Double
Dim Theta   As Double

x0 = 250
y0 = 350

With ActiveSheet

'Uh oh.  Here comes some math!  Have to calculate x and y

For Theta = TwoPi / 30 To nRevs * TwoPi Step TwoPi / 30

R = A + B * Theta

x = x0 + R * Sin(Theta)
y = y0 - R * Cos(Theta)

x0 = x
y0 = y

Next Theta

End With

ActiveWindow.Selection.ShapeRange.Group

End Sub``````

Of course, it is quite easy to plot a spiral from the data you have using a Scatter type plot with data smoothing (perhaps you have already done this) and to use a similiar algorithm to the above directly on a worksheet to calculate the spiral point coordinates.

Keep Excelling.

Damon

1,191,707
Messages
5,988,223
Members
440,139
Latest member
ngaicuong2017

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back