# Connect different points with curved line

**URL:** <https://community.thinkgeo.com/t/connect-different-points-with-curved-line/8493>\
**Category:** WinForms\
**Created:** [April 5, 2017, 7:04am UTC](https://community.thinkgeo.com/t/connect-different-points-with-curved-line/8493 "2017-04-05T07:04:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashok\_pydi](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@ashok\_pydi](https://community.thinkgeo.com/u/ashok_pydi)\
**Post date:** [April 5, 2017, 7:04am UTC](https://community.thinkgeo.com/t/connect-different-points-with-curved-line/8493/1 "2017-04-05T07:04:49Z")

</div>

Hi

I am working on an application which displays Weather Jetstream.  
In that I am connecting a group of points together and displaying winds on top it.

Here my requirement is I wanted to show connected points as a Curved line. But I am able to draw only straight lines.

Please look at following image for ref.

Right now i am getting like this

 ![](https://community.thinkgeo.com/uploads/default/original/3X/3/5/3527255fc22ced3481f3bafb4532f0778bf286f1.png)

But, I need like this.. .

 ![](https://community.thinkgeo.com/uploads/default/original/3X/3/f/3fa9be5bcd8b5fef2ed3e392a0e09b719278a190.jpg)

I think it is called as **cubic spline**.

Please provide me is there any code available. Or guide me how to do it.

Thanks  
Ashok

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [April 6, 2017, 3:38am UTC](https://community.thinkgeo.com/t/connect-different-points-with-curved-line/8493/2 "2017-04-06T03:38:33Z")

</div>

Hi Ashok,

I think this topic as below should be helpful.

> [@Draw curve line issue](http://community.thinkgeo.com/t/draw-curve-line-issue/2488):
>
> Hi, &nbsp;&nbsp;&nbsp;&nbsp;I&nbsp;want&nbsp;to&nbsp;draw&nbsp;curve&nbsp;line.&nbsp;I&nbsp;have&nbsp;from&nbsp;-to&nbsp;point,&nbsp;radius&nbsp;in&nbsp;Nautical&nbsp;mile,&nbsp;center&nbsp;point.&nbsp;I&nbsp;have&nbsp;tried&nbsp;with&nbsp;draw&nbsp;arc&nbsp;sample&nbsp;but&nbsp;it&nbsp;did&nbsp;not&nbsp;work&nbsp;for&nbsp;me.&nbsp;Please&nbsp;suggest&nbsp;how&nbsp;to&nbsp;draw&nbsp;curve&nbsp;line&nbsp;using&nbsp;all&nbsp;these&nbsp;parameters. Thanks, Goral &nbsp;&nbsp;&nbsp;&nbsp;

Regards,

Don

---

<div class="post-metadata">

**Author:** ![ashok\_pydi](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@ashok\_pydi](https://community.thinkgeo.com/u/ashok_pydi)\
**Post date:** [April 6, 2017, 4:09am UTC](https://community.thinkgeo.com/t/connect-different-points-with-curved-line/8493/3 "2017-04-06T04:09:26Z")

</div>

Hi Don,

Thanks for your reply… It looks like the above given post is just for drawing an arc or curve based on some angle/radius. But I want to connect the points just like how they are directing to…

I didn’t mean exactly curved. I mean to say i wanted to join the points but it should not be straight lines. it should have some smoothning as I shown in above pencil diagram.

Thank you…  
Ashok

---

<div class="post-metadata">

**Author:** ![Emil](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/emil/32/19043_2.png) [@Emil](https://community.thinkgeo.com/u/Emil)\
**Post date:** [April 6, 2017, 10:09am UTC](https://community.thinkgeo.com/t/connect-different-points-with-curved-line/8493/4 "2017-04-06T10:09:32Z")

</div>

Hi Ashok,

Currently, we have no sample for that.

I find a sample for Cubic Spline Interpolation, please refer to [https://www.codeproject.com/articles/560163/csharp-cubic-spline-interpolation](https://www.codeproject.com/articles/560163/csharp-cubic-spline-interpolation) . it seems to be what we want.

1. we learn this sample to create a interpolation logic to make the line more smooth.

2. Then we will create a customstyle inherit from LineStyle, and use the logic from 1 to get smooth line then draw it. here is a sample shows create a customstyle: [http://wiki.thinkgeo.com/wiki/source\_code\_wpfdesktopeditionsample\_multilinelabeling\_cs\_110316.zip](http://wiki.thinkgeo.com/wiki/source_code_wpfdesktopeditionsample_multilinelabeling_cs_110316.zip)

I guess a point we need to pay attention to here: the projection.  
here is a sample shows that  
[http://wiki.thinkgeo.com/wiki/map\_suite\_wpf\_desktop\_edition\_all\_samples#great\_circle\_with\_google\_map](http://wiki.thinkgeo.com/wiki/map_suite_wpf_desktop_edition_all_samples#great_circle_with_google_map)  
I think we need draw the line as above sample. because the position of any point on the line is match the position on the earth, at the same time i think the line is the shortest path between two point on the earth.I don’t know what projection you use, above is for reference only.

Thanks,  
Emil

---

<div class="post-metadata">

**Author:** ![ashok\_pydi](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@ashok\_pydi](https://community.thinkgeo.com/u/ashok_pydi)\
**Post date:** [April 13, 2017, 5:08am UTC](https://community.thinkgeo.com/t/connect-different-points-with-curved-line/8493/5 "2017-04-13T05:08:04Z")

</div>

Hi Emil,

Thanks for your great post. I have tried Cubic Spline Interpolation example which you posted above…

Its working out well… Thank you once again

–  
Ashok

---

<div class="post-metadata">

**Author:** ![Emil](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/emil/32/19043_2.png) [@Emil](https://community.thinkgeo.com/u/Emil)\
**Post date:** [April 13, 2017, 7:14am UTC](https://community.thinkgeo.com/t/connect-different-points-with-curved-line/8493/6 "2017-04-13T07:14:58Z")

</div>

Hi Ashok,

I am glad to hear that works.

Any question please let us know.

Thanks  
Emil
