Like there's an equation of a circle, is there any equation of a triangle?
I've been trying to build one and the closest thing I've managed to do is to create an equation of 2 lines and use the $x$ axis as the 3rd side of the triangle.
Here's how I built the two lines equation:
Let $m$ be the slope of the first line, $-m$ is the slope of the second line, and $a$ is the x-value of their intersection point.
The first thing we need to do is to find the y-intercept of the second line. Let's call it $p$. The first line equation is $y=mx$ and the second line equation is $y=-mx+p$
$ma=-ma+p$
$p=2ma$
So we need to build an equation that equals to $y=mx+n$ when $x<a$ and to $y=-mx+2ma$ when $x>a$. First lets handle the slope. It should be $m$ when $x<a$ and $-m$ when $x>a$.
This can be achieved by:
$\dfrac {a-x} {|a-x|} m$
The y-intercept of the final equation should be $0$ when $x<a$ and $2ma$ when $x>a$.
This can be achieved by:
$(\dfrac {x-a} {|a-x|} + 1)*2ma$
So our equation looks like:
$y=\dfrac {a-x} {|a-x|} mx+(\dfrac {x-a} {|a-x|} + 1)*2ma$
Simplified:
$y=\dfrac {-m(x-a)^2} {|a-x|} + ma$
Or:
$y=m(x-a)sgn(a-x)+ma$
Plot $m=2, a=5$:

So is there any way to build an equation for triangle without using the $x$ axis as the 3rd side of the triangle?

There is no standard equation for a triangle, like there is for a circle, parabola or ellipse. The reason is that the circle for example has a clear classic geometric definition: A locus of points. It would be something like "The collection of points that have a fixed distance to a given point". From such a definition one would use the distance formula to arrive at an algebraic equation. The circle, ellipse, parabola and hyperbola all have such classic definitions (they are conic sections) and hence a set of standard equations. A triangle does not fall in that category at all. There is no classic definition for a "collection of points" that uniquely describes a triangle.