Simple Projectile problem

I am having trouble drawing the path of the projectile in 3d

local p0 = workspace.p0
local p1 = workspace.p1

local v0x = 16
local v0y = 50
local v0 = math.sqrt(math.pow(v0x, 2) + math.pow(v0y, 2))
local theta = math.atan(v0y / v0x)
local g = workspace.Gravity

local function x(t)
	return v0 * t * math.cos(theta)
end

local function y(t)
	return v0 * t * math.sin(theta) - 1 / 2 * g * math.pow(t, 2)
end

local d = p1.Position - p0.Position
local y0 = d.Y
local T = (v0 * math.sin(theta) + math.sqrt(math.pow(v0 * math.sin(theta), 2) + 2 * g * y0)) / g

I am wonder how to do it, I cant figure it out.

A:

If you want a projectile path in 3D you need two things: a point of origin, and a velocity vector. The velocity vector has three components, (v_x, v_y, v_z).
The point of origin is the point in 3D space where the projectile starts. Let’s say that’s at the coordinates (x_0, y_0, z_0).
The trajectory of the projectile is then given by the parametric equations:
x(t) = x_0 + v_x * t
y(t) = y_0 + v_y * t
z(t) = z_0 + v_z * t

For example, if the point of origin is at (1, 1, 1) and the velocity vector is (2, 3, 4), then the trajectory would be:
x(t) = 1 + 2 * t
y(t) = 1 + 3 * t
z(t) = 1 + 4 * t

If you want to plot this in a 3D graph, you would need to discretize it, i.e. calculate x(t), y(t), and z(t) at a number of different points t and plot these points.