Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 Re: Help Me ! » Conic Sections » 2013-08-06 04:37:12

hi Bob,

I had to sort things out first, but now I have the rotation working:

You start with the hyperbola x.x / a.a - y.y / b.b - 1 = 0  [ x.x means x squared etc.]

This is a hyperbola with its center in the origin (0,0)

It's general equation is: A.x.x + C.y.y + F = 0

thus:
A = 1/a.a
C = -1/b.b
F = -1
(B = D = E = 0)

Rotation with angle theta means replacing
   x by  x.cos(theta) + y.sin(theta)   and
   y by  y.cos(theta) -  x.sin(theta)

Doing the algebra you find new coëfficients that describe the rotated hyperbola.

In Java:

// this is a method in my Conics-class, using global variables A thru F, that I adjust, forming a new Conics 

public void     rotate(double theta) {
   
      double c = cos(theta);
      double s = sin(theta);
     
      A1 = A*c*c + C*s*s;
      B1 = 2.0*c*s*(A-C);
      C1 = A*s*s + C*c*c;
   
      if (B != 0) {
         B1 = B1 + B*(c*c-s*s);
         A1 = A1 - B*c*s;
         C1 = C1 + B*c*s;
      }
      new Conics(A1, B1, C1, 0, 0, -1); // the class that produces a Shape (where A=A1, B=B1 andsoforth)
   }
when the original hyperbola already has a nonzero B-coefficient (was already rotated by some angle), you have to solve

B1 = B(xc+ys)(yc-xs) [same replacement of x and y as above]
 
this produces extra x.x and y.y terms, that you must add to A and C respectively.
   
success.

peter

#2 Re: Help Me ! » Conic Sections » 2013-08-04 19:41:52

Thanks, gnitsuk and others. I just registered in this forum because I was looking for a solution for exactly this problem.
I understood that, given the general equation of conic sections, the (best?) way to find the foci, is to
1. determine the type
2. rework the equation to the Standard form (rotate and translate)
3. find the foci, which should not be difficult
4. rotate and translate these, using info resulting from step 2
but...
I want to solve this in one step, foci directly from the general equation...just for fun
My Java program draws neat conic sections, drawn by 3 or 5 points. Drawing from 3 points (ellipse, hyperbola or parabola), 2 of these points are the foci. The 'problem' is the 5 points solution.
The 5 points are all on the outline (most often forming an ellipse) and to draw this conic I determine the coefficients A to F.
Than drawing the center goes well, but for the foci it seems I have to revert to the steps above and I don't like that.
just letting you know...

Board footer

Powered by FluxBB