# Get the normal vector(angle) on the point

**URL:** <https://forum.opencv.org/t/get-the-normal-vector-angle-on-the-point/4647>\
**Category:** C++\
**Created:** [August 7, 2021, 9:37am UTC](https://forum.opencv.org/t/get-the-normal-vector-angle-on-the-point/4647 "2021-08-07T09:37:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![niceguy\_sky](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/niceguy_sky/32/3001_2.png) [@niceguy\_sky](https://forum.opencv.org/u/niceguy_sky)\
**Post date:** [August 7, 2021, 9:37am UTC](https://forum.opencv.org/t/get-the-normal-vector-angle-on-the-point/4647/1 "2021-08-07T09:37:16Z")

</div>

I got the two partial differential function(X direction, Y direction) by using Sobel function in opencv. and then calculated magnitude by using magnitude function.  
and get the tangent angle by using phase function.  
when I using the phase function I wrote that —\> phase(sobel x, sobel y, result, true)

I want calculate normal vector(angle) on the point by using result of phase.  
I thought normal = direction / magnitude.  
so, I tried … but result looks like wrong.  
Can you guys teach to me right method???

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [August 7, 2021, 9:56am UTC](https://forum.opencv.org/t/get-the-normal-vector-angle-on-the-point/4647/2 "2021-08-07T09:56:46Z")

</div>

> [@niceguy\_sky](#):
>
> normal = direction / magnitude.

makes sense, if `direction` is a 2d vector,  
but dividing angles (phase !) by the resp. vector length – not at all

what do you need the vector for ?

---

<div class="post-metadata">

**Author:** ![niceguy\_sky](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/niceguy_sky/32/3001_2.png) [@niceguy\_sky](https://forum.opencv.org/u/niceguy_sky)\
**Post date:** [August 7, 2021, 10:02am UTC](https://forum.opencv.org/t/get-the-normal-vector-angle-on-the-point/4647/3 "2021-08-07T10:02:41Z")

</div>

Thank you for your reply.  
I want get the normal degree on the point.

 ![네이버질문](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/a/a06955545083afcb4f2612470f003a857217f087.jpeg)  
I aleady got the tangent angle. but how get the normal angle of tangent angle(red line)??

---

<div class="post-metadata">

**Author:** ![niceguy\_sky](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/niceguy_sky/32/3001_2.png) [@niceguy\_sky](https://forum.opencv.org/u/niceguy_sky)\
**Post date:** [August 7, 2021, 10:04am UTC](https://forum.opencv.org/t/get-the-normal-vector-angle-on-the-point/4647/4 "2021-08-07T10:04:32Z")

</div>

and finally I want draw the red line on the image.  
blue parabola is edge of canny.

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [August 7, 2021, 10:56am UTC](https://forum.opencv.org/t/get-the-normal-vector-angle-on-the-point/4647/5 "2021-08-07T10:56:24Z")

</div>

> [@niceguy\_sky](#):
>
> I aleady got the tangent angle. but how get the normal angle of tangent angle(red line)??

its just `theta + 90` …

---

<div class="post-metadata">

**Author:** ![niceguy\_sky](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/niceguy_sky/32/3001_2.png) [@niceguy\_sky](https://forum.opencv.org/u/niceguy_sky)\
**Post date:** [August 7, 2021, 11:37am UTC](https://forum.opencv.org/t/get-the-normal-vector-angle-on-the-point/4647/6 "2021-08-07T11:37:24Z")

</div>

Thank you for your reply. I thought so hardly…
