Closed solresol closed 10 months ago
f7a8c7b284
)[!TIP] I can email you next time I complete a pull request if you set up your email here!
The sandbox appears to be unavailable or down.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
plane.py
✓ https://github.com/solresol/wordplanes/commit/78fd01ccba8063fac8815c7e2131db43e5e75ff0 Edit
Create plane.py with contents:
• Create a new Python file named plane.py.
• Import numpy at the top of the file.
• Define a class named Plane.
• In the Plane class, define the constructor (__init__) that takes three points as input. The points should be numpy arrays. The constructor should calculate the normal vector to the plane and the distance from the origin to the plane.
• In the Plane class, define a method that takes a point as input and calculates the distance from the point to the plane. The method should also calculate the point on the plane that is closest to the input point. The method should return the distance and the closest point.
I have finished reviewing the code for completeness. I did not find errors for sweep/plane_class
.
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord
Details
Write a class called Plane. The constructor should take 3 points in a high dimensional vector space, and calculate the plane that passes through them. It should have a method that when given a point in that high dimensional vector space returns the distance from that point to the hyperplane (and what point on the hyperplane it was closest to)
Checklist
- [X] Create `plane.py` ✓ https://github.com/solresol/wordplanes/commit/78fd01ccba8063fac8815c7e2131db43e5e75ff0 [Edit](https://github.com/solresol/wordplanes/edit/sweep/plane_class/plane.py)