Jump to content

Wikipedia:Reference desk/Archives/Mathematics/2010 October 1

From Wikipedia, the free encyclopedia
Mathematics desk
< September 30 << Sep | October | Nov >> October 2 >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


October 1

[edit]

Transforming 3 points to a new coordinate plane in 3D Cartesian space

[edit]
Resolved

Hello,

I've inherited some C code that, among other things, takes three points specified in one 3D Cartesian coordinate system and (indirectly) converts their coordinates to a new coordinate system. For the first two points, the process by which this is done is quite clear. However, for the third point, I can't seem to figure out how the expressions used to determine the X and Y coordinates of the point were derived. Although I could just assume that the code is working fine and move on, I'd like to understand the logic behind the calculations.

I've included the expressions used to determine the coordinates of the three points in the new coordinate system below. In terms of notation, I refer to the points as P1, P2, and P3; the subscripts denote the coordinate (x, y, or z) and the coordinate system (O = old, N = new). For (hopefully) added clarify, I've made the coordinates specified in the old coordinate system red and those in the new coordinate system blue. The coordinates in the old coordinate system are known prior to these computations.


Point 1


This simply indicates that point 1 is the origin of the new coordinate system.


Point 2


This is also straight-forward: the intent is clearly for point 2 to lie on the x axis of the new coordinate system and its position on the x axis to be the magnitude of the vector connecting point 1 and point 2 in the original coordinate system (i.e. the distance between them).


Point 3


This where things get a bit confusing (for me, at least). Since the new Z coordinate for point 3 is set to zero, clearly points 1, 2, and 3 are being used to define the XY plane of the new coordinate system. Points 1 and 2 have already defined the X axis, so point 3 is then being used to define the orientation of the XY plane overall.

However, I can't figure out how the expressions for and were derived. Logically, I'd imagine that the expression for must represent some sort of projection of point 3 onto the line formed by point 1 and 2, but it's been a long time since I've done projections in 3D and unfortunately the form of this expression doesn't look familiar to me. I'm also unclear on what the expression for is getting at; it's very close to simply being the magnitude of the line connecting points 1 and 3, but then there's the presence of the additional term to be accounted for.

So, if anyone who has more familiarity with 3D coordinate transformations off the top of their head than I do has a possible explanation of how the expressions for and were derived, I'd be most appreciative!

Thanks,

Hiram J. Hackenbacker (talk) 00:56, 1 October 2010 (UTC)[reply]

P3xN is the length of the projection of the vector from P1O to P3O to the vector from P1O to P2O. That is P3xN = (P3O - P1O).(P2O - P1O)/||P2O - P1O||, where that "." denotes the dot product (see vector projection). They take advantage of the fact that ||P2O - P1O|| has already been calculated, since it's P2xN. P3yN is then just chosen in such a way to ensure that ||P3N|| = ||P3O - P1O|| since those need to be equal. Rckrone (talk) 03:48, 1 October 2010 (UTC)[reply]
Thanks, Rckrone - that clears it up. Hiram J. Hackenbacker (talk) 11:56, 1 October 2010 (UTC)[reply]

Poincaré-Hopf Theorem

[edit]

Assume that M is a compact, orientable, smooth manifold. Does the Poincaré-Hopf theorem tell us that a smooth vector field on M will have at most χ(M) zeros? If not then can someone give a counter example, e.g. a smooth vector field on the torus with two zeros: one with index −1 and one with index +1. Fly by Night (talk) 09:29, 1 October 2010 (UTC)[reply]

No it doesn't mean that (that would be the converse). I can't think at the moment of an example exactly like you say, but here's the standard example of a vector field on the torus with four zeros: Stand the torus up on vertically on its end, and dump syrup on the top of it. The syrup will flow down the torus, and use this flow to define a vector field. This will have four zeros: one at the top (source), one at the bottom (sink), and one at each of the top and bottom of the inner circle (saddles). So there's 4 zeros, of index +1, +1, -1, -1. (This example, with a good picture, is in Guillemin + Pollack's Differential Topology.) You can probably tweak this to make it have 2 zeros. Staecker (talk) 11:53, 1 October 2010 (UTC)[reply]

basic combinatorics

[edit]
Resolved

I am trying to deduce a formula for the number of partitions of an integer, say f(n) where order of the integers dont matter. For example 4 can be written in 8 ways: 4, 2+2, 1+3, 3+1, 1+1+1+1, 1+2+1, 2+1+1, 1+1+2, so f(4)=8. This is how I proceeded: First I already had a proof of this statement: If A is the set then A has cardinality . Since we basically need to count the number of elements in the set , so this number is . How can I simplify this to get which is supposed to be the answer. Or is there an easier way find f(n)? Thanks. Also regarding the fact of which I already have a proof of, namely, A has cardinality , the proof I have relies on an argument of making bars in between blanks, and actually deals with making selections with repetitions. Is there a wikipedia article about this technique. Thanks-Shahab (talk) 11:14, 1 October 2010 (UTC)[reply]

First see Bell number. Then see Multiset#Multiset_coefficients and stars and bars (probability). Bo Jacoby (talk) 11:20, 1 October 2010 (UTC).[reply]
I have read them, thanks. "Stars and bars" answers my second question completely. But I am still at a loss for showing to answer my original question. Also I am not sure why you linked Bell numbers.-Shahab (talk) 11:50, 1 October 2010 (UTC)[reply]
The arrangements that you are counting are called compositions. Since each of your xi must be at least 1, the cardinality of A, the compositions of n with k parts, is in fact
It is true that
but a simpler way to count the total number of compositions of n is given in Composition (number theory)#Number of compositions. Gandalf61 (talk) 11:52, 1 October 2010 (UTC)[reply]
Thanks a ton!-Shahab (talk) 12:12, 1 October 2010 (UTC)[reply]

using CAS to find the catenary parameter a that will give us a curve that will pass through a given point

[edit]

I want to find the equation of a catenary curve that will pass through the origin and a given (x,y) and (-x,y).

I see that a catenary is described by y=a*cosh(x/a). Since I want my curve to pass through the origin I will just subtract a to move it down to zero at x=0 so my new equation becomes y=a*cosh(x/a)-a. I figure that I can just solve for a in terms of the other variables but when I try to use a CAS (like ti-89 and wolframalpha) I get strange results. If i substitute actual values for x and y I can get a correct approximate numerical result but I cannot get a general equation of a in terms of x and y.

I am expecting that there can only be one value of a to satisfy a given (x,y) but apparently I am wrong. I have tried restricting the domains of a,x and y positive numbers less than infinity but I still can't work it out. Why can't I get a simple single result for a? Thanks so much. --- Diletante (talk) 20:41, 1 October 2010 (UTC)[reply]

I think a numerical solution is the best you can hope for since there isn't a way to solve for a with standard functions. The good news is that it's pretty easy reduce the problem to finding the inverse of a single function, namely (1/x)(cosh x -1).--RDBury (talk) 04:27, 2 October 2010 (UTC)[reply]
Set α=1/a. Then your equation y=a*cosh(x/a)−a is written cosh(xα)−yα−1=0. The left hand side is a nice entire function of α, and the equation is solved by a root-finding algorithm. Bo Jacoby (talk) 10:48, 2 October 2010 (UTC). The uninteresting solution α=0 is removed by division: , and the series expansion is . The first approximation is improved by Newton's method. Bo Jacoby (talk) 21:54, 2 October 2010 (UTC).[reply]

Thanks for the good answers. I will be honest and say that all this is a little bit beyond my ability to understand, but I am going to try my best to remember what I learned about approximation in cal 2 and read the articles Bo Jacoby linked. Thanks alot everyone! -- Diletante (talk) 02:08, 3 October 2010 (UTC)[reply]

Your premise is correct: Given and y, there is a unique value a for which y=a*cosh(x/a)-a. There is thus a function which gives for any values of x and y the corresponding value of a. However, just because the function exists doesn't mean it can be described in a nice "traditional" form, and indeed this function cannot. What you do next depends on your application. If you just want to be able to take numerical values of x, y and get a, I understand your calculator can already do this for you. You can also find a formula which gives an approximate answer. For example, if x is much larger than y, then , and you can solve that to find an approximate formula for a. -- Meni Rosenfeld (talk) 10:03, 3 October 2010 (UTC)[reply]
Ok I hope you all will indulge me for a little bit longer. I see that we can do a taylor series to approximate my f(x)=y. I see that we can solve the 2nd order taylor approximation to get a=2y/x^2. What i do not understand is how I can solve for a for greater orders of the taylor approximation (like the last approximation Meni gave). I take it that this is why Bo Jacoby suggested using the first approximation as a starting point to use newton's method, but I don't understand what that really means. Will newtons method allow me to write a better approximation of a algebraically, or just help me find a numerical result? In short, how can I write an approximation that is a little better than a=2y/x^2? -- 21:32, 3 October 2010 (UTC)
Newton's method is just for numerical results.
To solve the approximation I gave, you can use the method to solve cubic equations. But there's a better way to approach this.
Following RDBury's suggestion, we let . We can show that . Then we just need to find an approximation for . The series expansion of g is , and with some algebraic manipulations we can find as many terms as we want of the expansion . Plugging this in, we can find .
Again, this is good for small y. You can also find an approximation good for large y. Also, for any given , you can numerically find the value and derivatives of g around that point, and from that find an expression for the values of f around it (so you can get, for example, a formula which is good when ). -- Meni Rosenfeld (talk) 08:56, 4 October 2010 (UTC)[reply]
You want to find the value of for which = 0, where = A first approximation is = The derivative is, according to the quotient rule, = Newton's method is not just for numerical results. The second Newton approximation is = = or
This approximation is a little better than = . Don't forget that . So:
Bo Jacoby (talk) 13:19, 5 October 2010 (UTC).[reply]