I was was home schooled, so i never did much advanced geometry. I was bored one day and I started…

I was was home schooled, so i never did much advanced geometry. I was bored one day and I started to do math for fun, and I was curious about octagons. So I decided to come up with my own formula for calculating the width of an octagon (flat sid to flat side) by only having 1 diminution being the length of one side. The equation I created was loosely based around using the Pythagorean Theorem adapted to be used on an Octagon. I am almost positive that this formula works, and i was curious if this is that standard way of calculating this, or if I had come up with a new way of doing it? And if my way actually works properly, and if so how accurate it is?
My equation is as follows, (A/√2)*2+A=B, or A over Radical 2, times 2, plus A, equals B. A being the length of the side, and B being the width of the octagon from one side to the other. I used this equation to solve for a side length of 8, and the width according to my formula is 19.31 rounded to the nearest hundredth.
I am also curious if there is a similar equation that can be used to to take the width, and get the length of the sides, and not just what the formula is, but why it is the way it is?
In addition, I am curious what kinda math this is specifically, would it be geometry, algebra, a mix of the two, trig, or what?

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER