Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: produit vectoriel #5

Open
manuelddahmen opened this issue Oct 13, 2024 · 0 comments
Open

Error: produit vectoriel #5

manuelddahmen opened this issue Oct 13, 2024 · 0 comments

Comments

@manuelddahmen
Copy link
Owner

manuelddahmen commented Oct 13, 2024

Shound be:

    /**
     * Calculates the cross product between this point and the given point.
     *
     * @param p1 The point to calculate the cross product with.
     * @return The result of the cross product as a new Point3D object.
     */
    public Point3D prodVect(one.empty3.library.Point3D p1) {
        return new one.empty3.library.Point3D(p1.getY() * getZ() + -p1.getZ() * getY(), p1.getZ()
                * getX() - p1.getX() * getZ(), p1.getX() * getY() - p1.getY()
                * getX());
    }

    /**
     * Calculates the cross product between this point and the given point.
     *
     * @param p2 The point to calculate the cross product with.
     * @return The result of the cross product as a new Point3D object.
     * Corrigé d'après: <a href="https://www.nagwa.com/fr/explainers/616184792816/">...</a>
     */
    public Point3D prodVect1(one.empty3.library.Point3D p2) {
        Point3D p1 = this;

        return new one.empty3.library.Point3D(p1.getY() * p2.getZ() - p1.getZ() * p2.getY(),
                -(p2.getZ() * getX() - p2.getX() * getZ()),
                p1.getX() * p2.getY() - p1.getY() * p1.getX());
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant