I am wondering how I can use perspective rendering to render a point onto a 2d screen. An image showing perspective rendering:
Say I have a 3d point (with x, y, and z coordinates), a point for the camera, and a lookat point for the camera (the point that the camera is facing), how can I use this to plot the point?
In pseudo-code:
cameraPosition = [10, 6, 5] // Camera coordinates
cameraLookat = [5, 6, 5] // Where the camera is looking
pointA = [5, 5, 5] // X, Y, and Z coordinates
// Perspective render it to get 2d-coordinates
pointA2D = perspectivePlot(pointA, cameraPosition, cameraLookat)
Mathematically, how would the perspectivePlot function work? From my understanding, it needs to plot a line between the cameraPosition and pointA, then find where the line intersects a plane that is 1 unit away from cameraPosition at the angle determined by cameraLookat.
How could I do this? I am looking for the math formula for this, not necessarily written in pseudo-code.

The camera you're using to project determines a transformation from the 3D space to the 2D screen. Depending on the type of camera you're using, you will end up with different perspective projections. There are many books written about this.
But for this answer, I'll use a simple pinhole camera model. The way it works is by recording the position on the "film" (or screen) of ray of light reflected or emitted by objects in space. It's a pinhole camera because it only records those rays that reach the center of projection C.
As you can see on the diagram above, if $M$ is an arbitrary point in the 3D space, a ray of light $CM$ reaching the center of projection $C$ will intersect the screen at a point $P$. The diagram shows the view from above, in the $x-z$ plane, where the screen is assumed to be the $x-y$ plane.
Let $(x_M,y_M,z_M)$ be the coordinates of $M$ in 3D, and $(x_P, y_P)$ those of its projection $P$ on the screen.
The problem you're trying to solve is to compute $x_M$ and $y_P$, given $x_M$, $y_M$, and $z_M$.
By Thales' theorem: $$\frac{OP}{AM} = \frac{CO}{CA}$$ Thus $$x_P=\frac{CO}{CO + z_M}\cdot x_M\tag{1}$$ The value of $CO$ is intrinsic to the camera, and is often called the focal distance. Let's call it $f$. It doesn't depend on the input point $M$.
Thus your projection formula is $$\left \{\begin{split} x_P&=\frac{f}{f + z_M}\cdot x_M\\ y_P&=\frac{f}{f + z_M}\cdot y_M \end{split}\right.$$
Note that if you left $f\rightarrow+\infty$, then you recover the formula of the parallel projection: $$\left \{\begin{split} x_P&=x_M\\ y_P&=y_M \end{split}\right.$$