# 3D Bezier angle at point

**URL:** https://discourse.processing.org/t/3d-bezier-angle-at-point/10941
**Category:** Libraries
**Created:** [May 5, 2019, 12:16pm UTC](https://discourse.processing.org/t/3d-bezier-angle-at-point/10941 "2019-05-05T12:16:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Sudev](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Sudev](https://discourse.processing.org/u/Sudev)
#### Post date: [May 5, 2019, 12:16pm UTC](https://discourse.processing.org/t/3d-bezier-angle-at-point/10941/1 "2019-05-05T12:16:53Z")

</div>

Does anyone knows how to calculate angle at a particular point in 3D bezier curve ?

For example, consider there’s a ring to be inserted in BezierCurve. So can I get angles that ring makes in order for it to be parallel to the Bezier curve ?

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [May 6, 2019, 4:35pm UTC](https://discourse.processing.org/t/3d-bezier-angle-at-point/10941/2 "2019-05-06T16:35:05Z")

</div>

> [@Sudev](#):
>
> angles that ring makes in order for it to be parallel to the Bezier curve

By “ring” do you mean a circle, or an annulus?

By “parallel”, do you mean:

1. a circle that is tangent to the curve – the circumference of the circle touches the curve at one point?
2. OR: the centerpoint of the circle lies on the curve?
3. or something else?

Maybe share a drawing.

---

<div class="post-metadata">

### Author: ![Sudev](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Sudev](https://discourse.processing.org/u/Sudev)
#### Post date: [May 7, 2019, 8:07am UTC](https://discourse.processing.org/t/3d-bezier-angle-at-point/10941/3 "2019-05-07T08:07:35Z")

</div>

By “ring”, I do mean ‘annulus’ or torus.

By “parallel”, I mean the center of that annulus lies on the curve and also that annulus follows the curve. So if the curve is bent at 45degrees, I want that annulus to bet at 45 degrees. Hope I was able to make my point this time 😅. Only problem I am facing right now is that I have implemented Bezier curve in 3D space, am not able to get around that angle thing in 3D space.

---

<div class="post-metadata">

### Author: ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)
#### Post date: [May 7, 2019, 8:15am UTC](https://discourse.processing.org/t/3d-bezier-angle-at-point/10941/4 "2019-05-07T08:15:25Z")

</div>

Maybe you need to use PTF? ([Parallel Transport](https://en.wikipedia.org/wiki/Parallel_transport) Frames). That’s what you use to generate tubes and avoiding sudden flips of those rings in the middle of the tube. I think both HeMesh and ToxicLibs provide tube generation. I have ported this addon from C++ to Java in the past: [https://github.com/neilmendoza/ofxPtf](https://github.com/neilmendoza/ofxPtf) (I think I had to invert the matrices to make it work in Processing).

Is that the kind of thing you want to do?

---

<div class="post-metadata">

### Author: ![Sudev](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Sudev](https://discourse.processing.org/u/Sudev)
#### Post date: [May 7, 2019, 1:10pm UTC](https://discourse.processing.org/t/3d-bezier-angle-at-point/10941/5 "2019-05-07T13:10:53Z")

</div>

Yes, this is what I was looking for. Thanks for helping me out of this sinkhole. But it will take me few days to digest this Physics ! BTW you should also port ofxPtf to Javascript too. Thanks for the help mate !
