So I have an n-gon inscribed in a circle of radius 1. So the interior angles of an n-gon are 180*(n-2). Dividing this by n, I would obtain each individual interior angle. From here, using trig functions like sine/cosine, I could get coordinates of two points that form an edge, calculate distance between them, then multiply that distance by n to obtain the perimeter of the n-gon. Then as n grows large, the perimeter would approximate pi*diameter.
My question is, is this a valid way to approximate pi? By coding and running a program like this, am I just using the preprogrammed values of pi in calculating pi by using trig functions? Thanks.
Your method is a valid one, and your worries have some base. Let me explain.
As pointed out in the comments, the method of approximating $\pi$ using inscribed and circumscribed regular polygons with more and more edges, goes as far back as Archimedes. Well done for thinking the general method.
The big question of course is how do you calculate the side of a regular $n$-gon. You can do it by using trigonometric functions, but then this transfers the problem to how do you calculate the values for $sin(x)$ or $cos(x)$. You can use the built-in functions in any programming languages to get the values, as you mention. But these are black boxes to you, so you are right to be skeptical about what's going on inside. If, for example, these implementations use approximations of $\pi$ to begin with, this would defeat the purpose. So again, well done on your intuition.
It is difficult to find out what's going on in a particular implementation of a math library of your programming language of choice (see this question on stackoverflow to get an idea). They usually rely on a variety on precomputed tables, trig relationships, and power series. For example, they could rely on this power series: $$sin(x) = x - \frac{x^3}{3!} + \frac{x^5}{5!} -\frac{x^7}{7!} +\frac{x^9}{9!} - \dots$$ $x$ here is expressed in radians, so you need to know $\pi$ to do this. The precomputed values, do not necessarily have to rely on $\pi$. See this great educational page on how trig tables used to be computed in antiquity.
Even if $\pi$ is not used in modern implementations of $sin$ and $cos$ functions in computers (which seems unlikely) there are other issues. These implementations have certain accuracy limitations, so for example, it might not make sense to use them to approximate $\pi$ using a $1000$-gon. So without knowing in depth what these implementations are doing it's hard to justify their usage in this approximation task.
But there are good news. You don't have to use these implementations. You do not have to take arbitrary $n$-gons to approximate $\pi$, you just want them to have a large $n$. So you can choose your $n$ to result in easily computable $sin$. We know that $sin(\frac{\pi}{3}) = \frac{\sqrt3}{2}$ and that $sin(\frac{\pi}{4}) = \frac{\sqrt2}{2}$. We also know the $sin$ formulas for half angles. So find the $n$-gons that have the "easy" angles to compute. This way you can approximate $\pi$ arbitrarily close, using only the operations of addition, subtraction, multiplication, division, and square root.