Demo entry 6784831

Positionsbestimmung mit Hyperbeln

   

Submitted by Physik Facharbeit - Positionsbestimmung on Mar 10, 2019 at 19:31
Language: Python 3. Code size: 725 Bytes.

# Florian Hauser
# 10.03.2019
# Facharbeit Physik - Berechnung Position mit Hyperbeln


class Punkt():
    def __init__(self, x, y):
        self.x = x
        self.y = y


class Hyperbel():
    def __init__(self, a, P1, P2):
        self.a = a
        self.P1 = P1
        self.P2 = P2
        self.e = ((P1.x - P2.x)**2 + (P1.y - P2.y)**2)**(1/2)
        self.b = (self.e**2 - a**2)**(1/2)

    def Schnittpunkt(self, hyperbel):
        Sx = ((hyperbel.b**2 * self.a**2 * (- hyperbel.a**2 - self.b**2))/((hyperbel.a * self.a - self.b * hyperbel.b) * (hyperbel.a * self.a + self.b * hyperbel.b)))**(1/2)
        Sy = (- self.b**2 * (1 - Sx**2/self.a**2))**(1/2)
        print(str(Sx) + " | " + str(Sy))

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).