i know its a bit of a wierd question but you people are very knowledgable, does any1 know how to figure out the squre root of a number?
Printable View
i know its a bit of a wierd question but you people are very knowledgable, does any1 know how to figure out the squre root of a number?
include cmath
use sqrt()
remind me agen, how can i extract sums from libs?
Scratch that: sqrt=pow(number,0.5)
i need to write a power function now :confused:
>>i need to write a power function now
Then search the boards, there's sample code out there. Or simply write your own.
Does anyone here actually know the precise formula to find the square root of a number? I'm not neccessarily looking to find out how to do it (I could easily find the answer myself), but to see if someone knows the formula for it. My math teahcer said she used to know, but she hasn't used it in so long that she forgot what it is.
Davros, I don't particularly care to know the formula myself, yet to see if someone had the formula memorized themself.
you find the square root of a number by mulptliging a number by it self, the perfect quares in math are as fallowsQuote:
Originally posted by krappykoder
i know its a bit of a wierd question but you people are very knowledgable, does any1 know how to figure out the squre root of a number?
0=0
1=1
2=4
3=9
4=16
5=25
6=36
7=49
8=64
9=81
10=100
11=121
12=144
i know up to 15 but i jsut forgot them :)
No, that's the square of the number.Quote:
Originally posted by LouDu
you find the square root of a number by mulptliging a number by it self
Wow, and to think we were baffled all this time!Quote:
Originally posted by LouDu
you find the square root of a number by mulptliging a number by it self, the perfect quares in math are as fallows
LOLQuote:
Originally posted by abrege
Wow, and to think we were baffled all this time!
Do I detect a bit of sarcasm?
Wowzers! I gotta tell my math teachers about this! I gotta find all of them since my 4th grade class! I must tell them that they taught me the square root wrongly! Haha! I can't wait to see the looks on their faces!Quote:
you find the square root of a number by mulptliging a number by it self, the perfect quares in math are as fallows
This is taught to first year plumber and pipefitter appretices which is also how I was taught in school. It is rather convoluted though:
http://mathforum.org/library/drmath/view/52610.html
[edit]
typo's again
[\edit]
I dont know what convoluded means but it sure it complicated
It's convoluTed, look here for a definition.
Mathworld is a good reference for mathematical topics. Here is another definition of convolution.
http://mathworld.wolfram.com/Convolution.html
The reason i want to know this is to find the length of a line, unless some1 knows a way to not use sqrt
Why do you want to use sqrt() to find the length of a line? What line?
ill post my basic code
Not using the sqr route the line would be to long or too shortCode:FOR a = 1 TO SQRT((x1 - x) + (y1 - y))
x = x + .5
y = (y + ((y1 - y) / (x1 - x) / 2))
DOT x, y
NEXT
Calculating the length of a line. You mean the theorem of Pythagoras?
http://mathworld.wolfram.com/PythagoreanTheorem.html
Back to the original question:
>I'm not neccessarily looking to find out how to do it (I could
>easily find the answer myself), but to see if someone knows the
>formula for it. My math teahcer said she used to know, but she
>hasn't used it in so long that she forgot what it is.
The same with me. I learned it in the math lessons at university, but it is a long time ago that I did that, like some other math I currently don't use much anymore. If I would see the algorithm I will probably understand it again, but I currently don't remember how to do it.
Use sin cos or tan if you don't wish to use the square root function.
How do i use cos() to do it??
Do you know any of the other lengths and or angles?
The above code will plot a line from x,y to x1,y1
Then all you need to do is take the arctan of opposite side/ adjacent side to get an angle then use cos or sin with the appropiate length of one of the sides.
why in the world do you want to do this without using a sqrt function?
You confuse me, i never use geometry exept for my circle() function
Do you know any trig.?
i cant use -metery :D
That sucks, why not?
Never been taught it yet :-p
it's easier to learn trig from a teacher than from the internet. Most internet sites make you jump into it really quickly, where a teacher will make sure you learn the basics b4 going into the hard stuff. At least, if they are any good :p.
I thought distance formula was this:.Code:sqrt((x2-x1)^2 + (y2-y1)^2)
i was told my way by a very clever person :-p
ask him how his way works, and then tell me. you may be trying to do something differently than I think you are. In math, there are always a million ways to do one thing.