Creating a function that will calculate the equation of a line in 3D space

Hi, I am in need of some help. I am currently writing a program that will take a camera position and a point in space and project that point onto a 2D image plane. One function that I need to create is to create a function that gives an equation of a line (in parametric form) given two points (the camera position and the random point). I know how to do this with pen and paper https://www.youtube.com/watch?v=iqJ9vaPoHkQ&t=309s
but I don’t know how to program this. Thanks!

From what I understand, you need the camera position? https://processing.org/reference/camera_.html

If you generate a random point in 3D space, then you should be able to trace the line using the provided line() function.

Are you changing the camera position in your code?

Do

you need two functions for a line

y=mx+b
z=mx+b

then x++;

plug i nm and b

of course you would have remember that the y values go down etc.