Cubed roots programmatically

G

Guest

Figured it out! Thanks to anyone who may have written before I posted this
secod one.

tj
 
J

Jason Morin

Sub CubeRoot()
Dim i As Long
i = 65
MsgBox "Cube root of " & i & _
" is " & i ^ (1 / 3) & "."
End Sub

HTH
Jason
Atlanta, GA
 
B

Bernie Deitrick

Jack,

I think you're thinking of the other roots of polynomials - numbers have one
and only one cube root - they can have two different "even numbered" roots:
+/- the same number.

HTH,
Bernie
MS Excel MVP
 
J

Jack Schitt

If that is the consensus then I stand corrected. Currently I am of the
opinion that a number has two square roots (+/- as you mentioned), three
cube roots, 4 x 4th roots and so on.

If you express numbers on a two-dimensional graph with real and complex
orthogonal axes, the act of multiplication of two points on the plane has
the effect of multiplying their absolute distances from the origin and
adding the angle of the vector respective to the real axis.

The square roots are unusual in having no complex element if there is no
complex element in a positive number to be "rooted". This is because there
is 180 degree difference between the positive and negative root, both of
which lie on the real axis. Adding 180 degrees to the vector of the
negative number will map it back onto the real axis.

In the case of a cube root the other two cube roots will be 120 degrees off
the real plane, and so will have a complex element. This will also explain
the (wholly) complex element of square roots of negative numbers (90 degrees
+ 90 degrees making up the 180 degrees necessary to get to the negative part
of the real axis).
 
J

Jack Schitt

Actually I don't think that I needed to go to that much trouble. Once you
have (as you have) accepted that a third power or cubic polynomial has three
roots then it is a small step to demonstrate that a number has three cube
roots.

x^3 - 8
is a polynomial, whose roots are by definition the solution for x of the
equation
x^3 - 8 = 0
which can be expressed alternatively as
x^3 = 8

The cube root of 8 is by definition that number which when raised to the
third power equals 8.
This is nothing more than expressing long-hand the equation
x^3 = 8

As you have accepted that a third power polynomial has 3 roots then so does
the number 8.
 
B

Bernie Deitrick

As you have accepted that a third power polynomial has 3 roots then so
does
the number 8.

Yes, but they are all the same. So, in any meaningful way, the number 8 has
one cube root.

Bernie
 
B

Bill Martin

As you have accepted that a third power polynomial has 3 roots then so does
the number 8.

Ok, so what do you think the three cube roots of 8 (or any other rational
number) are? Give an example.

Bill -- (Remove KILLSPAM from my address to use it)
 
J

Jack Schitt

Bernie Deitrick said:
Yes, but they are all the same. So, in any meaningful way, the number 8
has
one cube root.

Bernie

I fear that we will have to agree to differ. I am open to conviction
otherwise, but I think that the three cube roots of 8 are distinct, namely

2

-2SIN(PI/6) + 2iCOS(PI/6)

-2SIN(PI/6) - 2iCOS(PI/6)

where i = (-1)^0.5

Try expanding one of them, say

(-2SIN(PI/6) + 2iCOS(PI/6))^3

converting all instances of (-i)^2 to -1
you should find that all first order multiples of i cancel out
and the remainder and up to 8
 
D

Dana DeLouis

For the cube root of 8. The following 3 different numbers, when cubed,
return 8

Sub Demo()
Dim n1, n2, n3

n1 = "2+0i"
n2 = "-1-1.7320508075688774i"
n3 = "-1+1.7320508075688774i"

Debug.Print ImAbs(ImPower(n1, 3))
Debug.Print ImAbs(ImPower(n2, 3))
Debug.Print ImAbs(ImPower(n3, 3))
End Sub

It returns:
8
8
8

To make it simple, I just used ImAbs to remove the small Imaginary
component.
 
A

AlfD

Hi!

Nobody is wrong provided they are careful to define their terms whe
necessary.

In the field of real numbers there is 1 cube root of any number.
In the field of complex numbers there are 3 cube roots for any numbe
(or, indeed, n nth roots for any number, though occasionally they ca
coincide: try finding the n nth roots of zero).

Nothing strange: nothing to divide us!

Al
 
J

Jack Schitt

AlfD said:
Hi!

Nobody is wrong provided they are careful to define their terms when
necessary.

In the field of real numbers there is 1 cube root of any number.
In the field of complex numbers there are 3 cube roots for any number
(or, indeed, n nth roots for any number, though occasionally they can
coincide: try finding the n nth roots of zero).

Nothing strange: nothing to divide us!

Alf

I suppose we could, if we chose, go back to Roman times and exclude zero
from the field of numbers to be considered. That would make life
interesting :)

Indeed we could allow ourselves only to work with positive numbers, and then
they would only have one square root.

In the absence of a specified restriction, I think it reasonable to assume
its absence, and work to the general case.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top