/** * Constructs a {@link ArchimedeanSpiral3D} with the specified parameters. * * @param scale {@code double} Factor which determines the overal size of the spiral. * @param density {@code double} Factor which determines how tightly the spiral is curled. Smaller values result in tighter curling. * @param start {@link Vector3} The point where the spiral should start from. * @param normal {@link Vector3} The normal vector of the plane the spiral is in. This is assumed to be * orthogonal to the vector formed from the start to the origin. * @param spiralIn {@code boolean} True if the spiral should move from the staring point in. False to move from starting point out. * Note that for an Archimedean spiral, inward spiraling is not infinite as is the case for a logarithmic * spiral. A sufficient number of rotations will cause a "loop" to form and it will begin spiraling outward. */ public ArchimedeanSpiral3D(double scale, double density, Vector3 start, Vector3 normal, boolean spiralIn) { super(density, start, normal, spiralIn); // Calculate the remaining conditions a = scale; mInvDensity = 1.0 / mDensity; // Calculate the starting offset mThetaOffset = mSpiralIn ? calculateThetaForRadius(mStart.length()) : mRotation.getXAxis().angle(mStart); }
/** * Constructs a {@link ArchimedeanSpiral3D} with the specified parameters. * * @param scale {@code double} Factor which determines the overal size of the spiral. * @param density {@code double} Factor which determines how tightly the spiral is curled. Smaller values result in tighter curling. * @param start {@link Vector3} The point where the spiral should start from. * @param normal {@link Vector3} The normal vector of the plane the spiral is in. This is assumed to be * orthogonal to the vector formed from the start to the origin. * @param spiralIn {@code boolean} True if the spiral should move from the staring point in. False to move from starting point out. * Note that for an Archimedean spiral, inward spiraling is not infinite as is the case for a logarithmic * spiral. A sufficient number of rotations will cause a "loop" to form and it will begin spiraling outward. */ public ArchimedeanSpiral3D(double scale, double density, Vector3 start, Vector3 normal, boolean spiralIn) { super(density, start, normal, spiralIn); // Calculate the remaining conditions a = scale; mInvDensity = 1.0 / mDensity; // Calculate the starting offset mThetaOffset = mSpiralIn ? calculateThetaForRadius(mStart.length()) : mRotation.getXAxis().angle(mStart); }