- Home /

# LineRenderer: 2D Parabola in 3D Space

Hey all,

I've been working on creating a program that can create a 2D parabola in 3D space (for arcs, and such) but am having some trouble with the third dimension. I've been using this code to generate the parabola:

```
int i = 0;
while (i < accuracy) {
float z = interval * i;
float y = ((a * (z * z)) + (b * z) + c);
Vector3 position = new Vector3(x * i, y, z + arcCaster.position.z);
arc.Add(position);
i++;
}
```

...where z is a public float and a, b, and c, can be found by:

```
a = power;
b = power * h * -2;
c = (power * (h * h)) + maxHeight;
```

All this is based on the vertex form of the quadratic equation:

```
a(x-h)^2 + k
```

or

```
power(x–HValue())^2 + maxHeight
float HValue () {
return Mathf.Sqrt ((arcCaster.position.y - maxHeight) / (1/-power));
}
```

Now this gives me a nice arc:

But I cannot rotate this arc. It needs to be able to point in the direction of the cube. My initial thought was to put the positions in a line renderer, set it to local space, and then make the line renderer a child of the cube. But then I realized that I needed those positions for other things, and the positions of the line renderer were in local, not world space.

If I could get the positions of the line renderer and then convert it to world space that would be great. But looking around it doesn't seem like that's possible. Any solutions to this?

### 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.