Write the perimeter of the triangle formed by the points O (0, 0), A (a, 0) and B (0, b).
The distance $d$ between two points $\left(x_{1}, y_{1}\right)$ and $\left(x_{2}, y_{2}\right)$ is given by the formula
$d=\sqrt{\left(x_{1}-x_{2}\right)^{2}+\left(y_{1}-y_{2}\right)^{2}}$
The perimeter of a triangle is the sum of lengths of its sides.
The three vertices of the given triangle are O(0, 0), A(a, 0) and B(0, b).
Let us now find the lengths of the sides of the triangle.
$O A=\sqrt{(0-a)^{2}+(0-0)^{2}}$
$=\sqrt{a^{2}}$
$\mathrm{OA}=a$
$\mathrm{AB}=\sqrt{(a-0)^{2}+(0-b)^{2}}$
$\mathrm{AB}=\sqrt{a^{2}+b^{2}}$
$\mathrm{OB}=\sqrt{(0-0)^{2}+(0-b)^{2}}$
$=\sqrt{b^{2}}$
$\mathrm{OB}=b$
The perimeter ‘P’ of the triangle is thus,
$\mathrm{P}=\mathrm{OA}+\mathrm{AB}+\mathrm{OB}$
$=a+\sqrt{a^{2}+b^{2}}+b$
$P=a+b+\sqrt{a^{2}+b^{2}}$
Thus the perimeter of the triangle with the given vertices is