- Home /

# Vector2 calculate bezier anchor point based on vectors

I've spent some time trying to work out how to achieve the following but I am unsure of how to proceed.

Please see the attached image

Currently I am getting a bezier weighted on the anchor point **x** however the line does't appear to be perpendicular. On top of that when the vector between the two points is facing some directions **x** is calculated on top of or behind the starting vector.

**Answer** by Bunny83
·
Jul 30, 2018 at 01:52 PM

Uhm your calculations is correct. So "perp" is a relative direction vector that is perpendicular to the direction between your two points. However it's not clear what the actual problem is. Note there are different kind of bezier curves (quadratic, cubic or higher order). Also depending on the used equation you may need to use a tangent vector instead of a control point position. Why don't you should your actual code?

I'll post up the code tomorrow sorry was going to bed didn't expect anyone to answer so soon.

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.

### Follow this Question

### Related Questions

Create a circle or ellipse with the GL class 1 Answer

How to convert cubic Bezier curve into AnimationCurve 1 Answer

Correct normals on a cylindrical rail (hairy ball theorem) 0 Answers

What could be causing this problem reading from a Rect into a Vector2? 3 Answers

How can I translate a Vector2 control system to Vector3 and rotate? 1 Answer