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

Add Sphere3D #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add Sphere3D #186

wants to merge 1 commit into from

Conversation

fcsangminpark
Copy link

No description provided.

throw new ArgumentException("The radius is negative.");
}

this.CenterPoint = centerPoint;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all this. qualifiers

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC we use StyleCop with default settings in this repro so if so this. is correct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have already removed all "this." references in a previous commit, and the CI build didn't complain, so I thought it was an acceptable change

/// <param name="p3">The third point on the sphere</param>
/// <param name="p4">The last point on the sphere</param>
public static Sphere3D FromFourPoints(Point3D p1, Point3D p2, Point3D p3, Point3D p4)
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would favor an implementation which is easier to follow, based for example on intersections of planes and lines

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be useful to have additional methods, like

  • intersection of sphere with line/ray
  • intersection of sphere with plane
  • intersection of sphere with another sphere
  • functions which check if a point lies inside/on/outside of the circle

using MathNet.Spatial.Euclidean;
using NUnit.Framework;

namespace MathNet.Spatial.UnitTests.Euclidean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix namespace

@jkalias jkalias changed the title Add sphere3D Add Sphere3D Mar 23, 2023
@jkalias jkalias self-requested a review March 24, 2023 16:24
Copy link
Member

@jkalias jkalias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix

/// <inheritdoc />
[Pure]
public override int GetHashCode() => HashCode.Combine(this.CenterPoint, this.Radius);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: empty rows here

@jkalias
Copy link
Member

jkalias commented May 5, 2023

@fcsangminpark any updates on this?

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

Successfully merging this pull request may close these issues.

3 participants