Package fmg.fmg8.endlAutomat.translator

Examples of fmg.fmg8.endlAutomat.translator.Translator


     * Setzt eine Seite des Rechtecks neu.
     *
     * @param yy2  Der zu setzende neue Wert.
     */
    public void setUnten(final double yy2) {
        this.set(this.linksOben, new Vektor2D(this.x2, yy2));
    }
View Full Code Here


     *
     * @param stuetz  Der St�tzpunkt.
     * @param richt   Die Richtung.
     */
    public Gerade2D(final Vektor2D stuetz, final Vektor2D richt) {
        this.stuetzPunkt = new Vektor2D(stuetz);
        this.richtung = new Vektor2D(richt);
    }
View Full Code Here

     * Konstruktor, der die Gerade als Verl�ngerung einer Strecke erzeugt.
     *
     * @param s  Die Strecke, aus der die Gerade erzeugt werden soll.
     */
    public Gerade2D(final Strecke2D s) {
        this.stuetzPunkt = new Vektor2D(s.getAnfPkt());
        this.richtung = new Vektor2D(s.getEndPkt());
        this.richtung.sub(s.getEndPkt());
    }
View Full Code Here

     *          v1.x * v2.y - v2.x * v1.y > konst
     *          gilt, mit konst = 0.0001.
     */
    public Vektor2D schnPktSpezial(final Gerade2D h) {
        final double nullKonst = 0.0001;
        final Vektor2D p1 = this.stuetzPunkt;
        final Vektor2D v1 = this.richtung;
        final Vektor2D p2 = h.stuetzPunkt;
        final Vektor2D v2 = h.richtung;
        Vektor2D zwisch;
       
        // Der Schnittpunkt der Geraden.
        Vektor2D q = new Vektor2D(p1);
        q.add(p2);
        q.div(2);

        if (v1.distanz(Vektor2D.NULL_VEKTOR) < nullKonst
            || v2.distanz(Vektor2D.NULL_VEKTOR) < nullKonst
            || Double.isNaN(v1.x) || Double.isNaN(v1.y)
            || Double.isNaN(v2.x) || Double.isNaN(v2.y)
            || Double.isNaN(p1.x) || Double.isNaN(p1.y)
            || Double.isNaN(p2.x) || Double.isNaN(p2.y)
            ) {
            if (Double.isNaN(p1.x) || Double.isNaN(p1.y)) {
                q = new Vektor2D(p2);
            }
            if (Double.isNaN(p2.x) || Double.isNaN(p2.y)) {
                q = new Vektor2D(p1);
            }
        } else {
            zwisch = this.schnPkt(h);
           
            if (zwisch != null) {
View Full Code Here

     */
    public Vektor2D schnPkt(final Gerade2D h) {
        double t;
        double div;
        final double nullKonst = 0.0001;
        Vektor2D q = null;
        final Vektor2D p1 = this.stuetzPunkt;
        final Vektor2D v1 = this.richtung;
        final Vektor2D p2 = h.stuetzPunkt;
        final Vektor2D v2 = h.richtung;
       
        t = v1.y * (p2.x - p1.x) - v1.x * (p2.y - p1.y);
        div = v1.x * v2.y - v2.x * v1.y;
       
        if (Math.abs(div) > nullKonst) {
            t /= div;
            q = new Vektor2D(v2);
            q.mult(t);
            q.add(p2);
        }
       
        return q;
View Full Code Here

     *
     * @param anfang  Der Anfangspunkt der Geraden.
     * @param ende    Der Endpunkt der Geraden.
     */
    public Strecke2D(final Vektor2D anfang, final Vektor2D ende) {
       this.anfPkt = new Vektor2D(anfang);
       this.endPkt = new Vektor2D(ende);
    }
View Full Code Here

     * Gibt die Richtung der Gerade normiert zur�ck.
     *
     * @return  Die Richtung der Geraden.
     */
    public Vektor2D getNormRicht() {
        Vektor2D richt = new Vektor2D(this.endPkt);
        richt.sub(anfPkt);
        richt.normal();
        return richt;
    }
View Full Code Here

     *
     * @return  Der Schnittpunkt von g ung h. Wenn die Strecken keinen
     *          Schnittpunkt haben, wird <code>null</code> zur�ckgegeben.
     */
    public Vektor2D schnPkt(final Strecke2D q) {
        Vektor2D vp, vq;
        Gerade2D g, h;
        vp = this.getNormRicht();
        vq = q.getNormRicht();
       
        g = new Gerade2D(this.anfPkt, vp);
        h = new Gerade2D(q.anfPkt, vq);
       
        Vektor2D strSchnPkt = g.schnPkt(h);
       
        if (strSchnPkt == null) {
            return null;
        }
       
        if (strSchnPkt.istInRechteckOR(this.anfPkt, this.endPkt)
            && strSchnPkt.istInRechteckOR(q.anfPkt, q.endPkt)) {
            return strSchnPkt;
        } else {
            return null;
        }
    }
View Full Code Here

     * @param rad  Radius des Kreises.
     */
    public Kreis2D(final double x,
                   final double y,
                   final double rad) {
        this.mittelpunkt = new Vektor2D(x, y);
        this.radius      = rad;
    }
View Full Code Here

     * @param mit  Mittelpunkt des Kreises.
     * @param rad  Radius des Kreises.
     */
    public Kreis2D(final Vektor2D mit,
                   final double rad) {
        this.mittelpunkt = new Vektor2D(mit);
        this.radius      = rad;
    }
View Full Code Here

TOP

Related Classes of fmg.fmg8.endlAutomat.translator.Translator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.