Wikipedia:Reference desk/Archives/Mathematics/2016 March 22

= March 22 =

Carpentry Question - Intersecting Planes
I'm trying to build something, and the math has escaped me.

Imagine I have two boards perpendicular to each other and to the floor, and adjacent to each other. I want to bevel each board at a 45 degree angle so they meet evenly. So far so good.

Now, each board has to tilt in, so their bases are in the same place, but they are no longer at right angle to the floor. Worse, they tilt in at different amounts. If I know my two tilt angles (call them A and B), how do I calculate the bevel I need to cut for their intersection? Tdjewell (talk) 13:26, 22 March 2016 (UTC)
 * Consider af sphere having centre in common intersection between the floor and the two boards. The intersections between the sphere and the floor, and between the sphere and the boards, make a spherical triangle ABC. The side c is 90 degrees. The angle A is 45 degrees. The angle B is 45 degrees. You want to calculate the sides a and b. Now use the formulas of spherical trigonometry. Bo Jacoby (talk) 13:46, 22 March 2016 (UTC).


 * cos(C) = −cos(A)cos(B) + sin(A)sin(B)cos(c)
 * cos(C) = −cos(45°)cos(45°) + sin(45°)sin(45°)cos(90°) = 0
 * C = 90°
 * sin(A)/sin(a) = sin(C)/sin(c) = 1
 * sin(a) = sin(45°) = 1
 * a = 45°
 * Similarily
 * b = 45°
 * Bo Jacoby (talk) 14:21, 22 March 2016 (UTC).


 * Perhaps I'm not understanding the question, because Bo's response doesn't make sense to me, but aren't you looking for the dihedral angle between the two boards in order to determine the bevel from that?
 * Let's work this in Cartesian 3-space with the base lying in the xy-plane. For your un-tilted example with A = B = 0°, consider the first board lying in the xz-plane with unit normal (0,1,0) and the second board lying in the yz-plane with unit normal (1,0,0).  The dot product of the unit normals is 0, so the dihedral angle between the two boards is acos(-0) = 90°, giving a bevel of 45° (whichever way you choose to define the bevel angle -- more on that later).
 * Now tilt the two boards in by angles A and B. The unit normals will become (0, cos A, -sin A) for the first board and (cos B, 0, -sin B) for the second.  Their dot product is sin A · sin B giving a dihedral angle of acos(-sin A · sin B).
 * There seems to be some disagreement about how to define and measure the bevel or miter angle, with parties taking complementary positions so that one carpenter's 43° is another carpenter's 47°. See Miter Angles and Miter Saws.  I choose the definition which describes a square cut board as having a 90° bevel (not a 0° bevel), and where a 10° bevel yields a long, narrow taper, and not a board just a bit off square.  This is consistent with a knife maker's definition, and corresponds to the labeling of this miter saw.
 * Using that definition, the bevel is half the dihedral angle, or 0.5 acos(-sin A · sin B). For example, if A = 10° and B = 20°, the dihedral angle would be acos(-sin 10° · sin 20°) ≈ 93.4° with a bevel of approximately 46.7°.
 * (If you prefer the other definition which yields a bevel of 43.3°, you can either take the complement of 0.5 acos(-sin A · sin B), or take advantage of some identities and drop the negative sign from the equation, giving 0.5 acos(sin A · sin B).) -- ToE 16:43, 22 March 2016 (UTC) [Edit: Cleaned up response, clarified definitions, and gave derivation. -- ToE 19:30, 23 March 2016 (UTC)]


 * As a practical matter, I believe your average carpenter would keep increasing the bevel angle and testing it out until they got it right, using smaller adjustments in the angle as they approached a good fit. Once they got a good fit, they would use the same angles on any identical or mirrored joints. StuRat (talk) 18:33, 22 March 2016 (UTC)

Non-radial cuts of circles...
How easy is it to figure out the following. I want to cut a circle into 5 equal pieces, *but* the cuts must be perpendicular to each other. So I need a straight line that *either* cuts the circle into 3/5 & 2/5 or 4/5 & 1/5 and then how to cut the larger piece into the appropriate number (splitting the 2/5 is easy). How is this done?Naraht (talk) 14:08, 22 March 2016 (UTC)


 * Did you mean to write "parallel" instead of "perpendicular"? If so, you are asking for the points t so that the area under the curve y = sqrt(r^2 - x^2) (a semicircle of radius r centered at the origin between) -r and t is 1/5, 2/5, ... of the entire bounded region.  This is a straightforward integration problem; do you need details?  --JBL (talk) 14:16, 22 March 2016 (UTC)
 * No, perpendicular. The first would be parallel to the x-axis. any later would be parallel to the y-axis. I agree that the first would be relatively simple, the second, I guess would seem to be somewhat more complicated.Naraht (talk) 14:21, 22 March 2016 (UTC)
 * It's not that bad: you have to solve in terms of the height of the first cut, but symmetry means that in either case there is only one number you have to solve for, and the key step is computing the same integral. The final equation will have an inverse trig function in it and probably can't be solved in elementary functions, but computing the root numerically should be no problem. --JBL (talk) 14:34, 22 March 2016 (UTC)
 * Having just done the calculations, it looks like the first should be along the line y = -0.491862..., with vertical cuts to the larger piece at x = 0 and x = ±0.430332..., or the first should be at y = -0.157736... with a vertical cut to the smaller piece at x = 0 and vertical cuts to the larger piece at x = ±0.274364.... (I do not guarantee I have not made an error.) --JBL (talk) 20:54, 22 March 2016 (UTC)
 * Just to confirm, the first solution has the top piece being 4/5 originally and the second solution has the top piece being 3/5 originally, correct?Naraht (talk) 13:38, 23 March 2016 (UTC)
 * Yes. --JBL (talk) 13:47, 23 March 2016 (UTC)


 * The area of a Circular_segment with central angle v and radius 1 is
 * (v−sin(v))/2.
 * Bo Jacoby (talk) 14:28, 22 March 2016 (UTC).


 * There's likely to be some guidance at Chord (geometry) in how to solve this. Circle notes "The sum of the squared lengths of any two chords intersecting at right angles at a given point is the same as that of any other two perpendicular chords intersecting at the same point, and is given by 8r2 – 4p2 (where r is the circle's radius and p is the distance from the centre point to the point of intersection)."  Maybe that is of some help?  -- Jayron 32 15:47, 22 March 2016 (UTC)
 * The area of the unit circle is π.
 * The central angle v of the segment having area π/5 satisfies the equation v−sin(v) = 2π/5. So v = 2.11717 radian = 121°.
 * The central angle v of the segment having area 2π/5 satisfies the equation v−sin(v) = 4π/5. So v = 2.8248 radian = 162°. Bo Jacoby (talk) 19:39, 22 March 2016 (UTC).


 * You didn't explicitly specify that each cut has to go all the way across the piece produced by the previous cut. Thefore it is not necessarily true that you need a straight line that *either* cuts the circle into 3/5 &amp; 2/5 or 4/5 &amp; 1/5 and...


 * You could alternatively make four cuts which are the sides of a square (square side length $$\scriptstyle{\sqrt{\frac{\pi}{5}} r}$$) centred on the disc and with each cut extended to the perimeter of the disc in one direction only (clockwise or anticlockwise). The area of the square is one fifth that of the disc, and the remaining four pieces are congruent and so must also each be one fifth the area. catslash (talk) 22:14, 22 March 2016 (UTC)


 * Actually the four cuts described will be all "all the way across" from the original perimeter to a previously cut edge, if you make the four cuts simultaneously, starting each at the perimeter and proceeding inward until dropping off the next cut around. catslash (talk) 22:39, 22 March 2016 (UTC)


 * (I was assuming you meant disc rather than circle there; please excuse me if that was not the case) catslash (talk) 22:18, 22 March 2016 (UTC)
 * Ooooh, pretty! I didn't even think about the idea of a central square.Naraht (talk) 13:38, 23 March 2016 (UTC)

Tensor product of real and p-adic numbers
What does the ring $$\mathbb{R} \otimes_{\mathbb{Q}} \mathbb{Q}_p$$ look like for a prime number p? Is it a field? GeoffreyT2000 (talk) 16:56, 22 March 2016 (UTC)
 * It is not a field: let $$0\le a \in \mathbb{Q}$$ be a positive rational number which is a square in $$\mathbb{Q}_p$$ but not in $$\mathbb{Q}$$ (for example, $$a=p^4+1$$). Then

$$ \left(1\otimes \sqrt{a} + \sqrt{a}\otimes 1\right)\left(1\otimes \sqrt{a} - \sqrt{a}\otimes 1\right) = 1 \otimes a - a \otimes 1 = 0$$, but $$ 1\otimes \sqrt{a} + \sqrt{a}\otimes 1 \neq 0 \neq 1\otimes \sqrt{a} - \sqrt{a}\otimes 1$$ --87.70.13.1 (talk) 18:49, 22 March 2016 (UTC)
 * No, see Tensor product of fields. If a satisfies some algebraic equation in $$\mathbb{R}$$ and b satisfies the same equation in $$\mathbb{Q}_p$$, there are too many solutions to that equation in the tensor product. What you usually do, to get things you can handle is to tensor some finite extension of $$\mathbb{Q}$$ with $$\mathbb{R}$$ or with $$\mathbb{Q}_p$$, getting a product of fields that describe the behavior of the extension at these places, as in that article.John Z (talk) 19:18, 22 March 2016 (UTC)

Multiplicative inverses in finite fields
In the article on the extended Euclidean algorithm, the section titled "Simple algebraic field extensions" gives this pseudocode:

function inverse(a, p)    t := 0;     newt := 1; r := p;    newr := a;         while newr ≠ 0 quotient := r div newr (r, newr) := (newr, r - quotient * newr) (t, newt) := (newt, t - quotient * newt) if degree(r) > 0 then return "Either p is not irreducible or a is a multiple of p"    return (1/r) * t

which I've almost implemented in Python, but I don't know how to carry out (1/r)*t. I'm trying to use this algorithm to calculate multiplicative inverses in finite fields, but it prints the error when I try to calculate the inverse for 3 in AES's Galois field. What's going on? — Melab±1 &#9742; 21:57, 22 March 2016 (UTC)
 * I think you'll have to provide some information about your implementation beyond that it's written in Python, such as the actual Python code, or at least the error message you got. (1/r) is the modular multiplicative inverse of r in the base field of your polynomial ring. If the base field is Z2 (which is the case for AES and most other CS uses of Galois fields) then if you make it to that line then r=1, so you can just return t. -- BenRG (talk) 22:41, 22 March 2016 (UTC)
 * Sorry, I guess you meant that it returns "Either p is not irreducible or a is a multiple of p". Are you implementing * and div correctly? They are polynomial multiplication and long division, not integer multiplication/division or Galois field multiplication/division. -- BenRG (talk) 23:03, 22 March 2016 (UTC)
 * Note that the usual way of doing arithmetic in smallish finite fields on a PC is to pick an arbitrary primitive element a and make an array exp[] = {a0, a1, ..., a2n-3} and its inverse log[1..n-1] with values in 0..n-2 (where n is the size of the field), and then compute x·y = exp[log[x] + log[y]] and x/y = exp[log[x] + n - 1 - log[y]]. You don't even have to implement full Galois-field multiplication for this, since you can pick a simple a and just write code to multiply by that constant. -- BenRG (talk) 23:05, 22 March 2016 (UTC)