Class Circle

  • All Implemented Interfaces:
    MeshMaker

    public class Circle
    extends Model
    implements MeshMaker
    Create a wireframe model of a circle in the xy-plane centered at the origin.
    • Field Detail

      • r

        public final double r
      • n

        public final int n
    • Constructor Detail

      • Circle

        public Circle()
        Create a circle in the xy-plane with radius 1 and with 16 line segments around the circumference.
      • Circle

        public Circle​(double r)
        Create a circle in the xy-plane with radius r and with 16 line segments around the circumference.
        Parameters:
        r - radius of the circle
      • Circle

        public Circle​(double r,
                      int n)
        Create a circle in the xy-plane with radius r and with n line segments around the circumference.
        Parameters:
        r - radius of the circle
        n - number of line segments in the circle's circumference
        Throws:
        IllegalArgumentException - if n is less than 3
    • Method Detail

      • remake

        public Circle remake​(int n,
                             int k)
        Description copied from interface: MeshMaker
        Build an instance of the Model with new values for the number of lines of latitude and longitude while keeping all the other model parameters the same.
        Specified by:
        remake in interface MeshMaker
        Parameters:
        n - number of lines of latitude for the returned Model
        k - number of lines of longitude for the returned Model
        Returns:
        a new instance of the Model with the updated parameters