Class PairZr
Value pair of Z and R.
public class PairZr : IMakeXmlSource, IExpandToBox3d, IEqualityOperators<PairZr, PairZr, bool>, IAdditionOperators<PairZr, PairZr, PairZr>, ISubtractionOperators<PairZr, PairZr, PairZr>, IMultiplyOperators<PairZr, double, PairZr>, IDivisionOperators<PairZr, double, PairZr>
- Inheritance
-
PairZr
- Implements
- Inherited Members
- Extension Methods
Constructors
PairZr()
Ctor.
public PairZr()
PairZr(PairZr)
Copy ctor.
public PairZr(PairZr src)
Parameters
src
PairZr
PairZr(double, double)
Ctor.
public PairZr(double z, double r)
Parameters
PairZr(string)
Ctor.
public PairZr(string src)
Parameters
src
string
PairZr(XElement)
Ctor.
public PairZr(XElement src)
Parameters
src
XElementXML
Properties
R
R value.
public double R { get; set; }
Property Value
XName
Name for XML IO.
public static string XName { get; }
Property Value
Z
Z value.
public double Z { get; set; }
Property Value
ZR
(x,y)=(z,r).
public Vec2d ZR { get; set; }
Property Value
Methods
Equals(PairZr)
public bool Equals(PairZr other)
Parameters
other
PairZr
Returns
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
ExpandToBox3d(Box3d)
Expands the destination box. This function is usually used to compute the bounding box of elements.
public void ExpandToBox3d(Box3d dst)
Parameters
dst
Box3dDestination box
GenCircle(int)
Generates a collection of Vec3d points forming a circle at the Z coordinate with radius R.
public IEnumerable<Vec3d> GenCircle(int posNum)
Parameters
posNum
intThe number of points to generate around the circle
Returns
- IEnumerable<Vec3d>
An enumerable collection of Vec3d points
GenPolarCircle(int)
Generates a collection of Polar3d points forming a circle at the Z coordinate with radius R.
public IEnumerable<Polar3d> GenPolarCircle(int posNum)
Parameters
posNum
intThe number of points to generate around the circle
Returns
- IEnumerable<Polar3d>
An enumerable collection of Polar3d points
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
MakeXmlSource(string, string)
Creates an XML representation of the object. This method may also generate additional resources such as related files.
public XElement MakeXmlSource(string baseDirectory, string relFile)
Parameters
baseDirectory
stringThe base directory for resolving relative paths
relFile
stringThe relative file path for the XML source
Returns
- XElement
An XML element representing the object's state
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
operator +(PairZr, PairZr)
Addition operator that adds two PairZr instances.
public static PairZr operator +(PairZr left, PairZr right)
Parameters
Returns
- PairZr
A new PairZr instance with the sum of Z and R values
operator /(PairZr, double)
Division operator that divides a PairZr instance by a scalar value.
public static PairZr operator /(PairZr left, double right)
Parameters
Returns
- PairZr
A new PairZr instance with Z and R values divided by the scalar
operator ==(PairZr, PairZr)
Equality operator that compares two PairZr instances.
public static bool operator ==(PairZr left, PairZr right)
Parameters
Returns
- bool
True if both instances are equal; otherwise, false
operator !=(PairZr, PairZr)
Inequality operator that compares two PairZr instances.
public static bool operator !=(PairZr left, PairZr right)
Parameters
Returns
- bool
True if the instances are not equal; otherwise, false
operator *(PairZr, double)
Multiplication operator that multiplies a PairZr instance by a scalar value.
public static PairZr operator *(PairZr left, double right)
Parameters
Returns
- PairZr
A new PairZr instance with Z and R values multiplied by the scalar
operator -(PairZr, PairZr)
Subtraction operator that subtracts one PairZr instance from another.
public static PairZr operator -(PairZr a, PairZr b)
Parameters
Returns
- PairZr
A new PairZr instance with the difference of Z and R values