Class PhysicalValuePair
- Namespace
- VirtualLabAPI.Core.Numerics
- Assembly
- VirtualLabAPI.dll
Class for a pair of physical values.
public class PhysicalValuePair
- Inheritance
-
PhysicalValuePair
- Inherited Members
Constructors
PhysicalValuePair(double, double, string, string, MeasuredQuantity, MeasuredQuantity)
Constructor with all parameters.
public PhysicalValuePair(double value1, double value2, string name1, string name2, MeasuredQuantity measuredQuantity1, MeasuredQuantity measuredQuantity2)
Parameters
value1doubleFirst numerical value
value2doubleSecond numerical value
name1stringFirst value's name.
name2stringSecond value's name.
measuredQuantity1MeasuredQuantityThe measured quantity of the first physical value.
measuredQuantity2MeasuredQuantityThe measured quantity of the second physical value.
PhysicalValuePair(double, double, MeasuredQuantity, MeasuredQuantity)
Constructor with all parameters but the names.
public PhysicalValuePair(double value1, double value2, MeasuredQuantity measuredQuantity1, MeasuredQuantity measuredQuantity2)
Parameters
value1doubleFirst numerical value
value2doubleSecond numerical value
measuredQuantity1MeasuredQuantityThe measured quantity of the first physical value.
measuredQuantity2MeasuredQuantityThe measured quantity of the second physical value.
PhysicalValuePair(PhysicalValue, PhysicalValue)
Constructor with two physical value parameters
public PhysicalValuePair(PhysicalValue value1, PhysicalValue value2)
Parameters
value1PhysicalValueFirst physical value
value2PhysicalValueSecond physical value
PhysicalValuePair(PhysicalValuePair)
Copy constructor.
public PhysicalValuePair(PhysicalValuePair pair)
Parameters
pairPhysicalValuePairPhysical value pair to copy.
PhysicalValuePair(VectorD, MeasuredQuantity)
Constructor taking a VectorD.
public PhysicalValuePair(VectorD value, MeasuredQuantity measuredQuantity)
Parameters
valueVectorDThe vector of doubles from which the physical value pair is constructed.
measuredQuantityMeasuredQuantityThe measured quantity of the vector.
Properties
MeasuredQuantity1
The measured quantity of the first value.
public MeasuredQuantity MeasuredQuantity1 { get; set; }
Property Value
- MeasuredQuantity
MeasuredQuantity2
The measured quantity of the second value.
public MeasuredQuantity MeasuredQuantity2 { get; set; }
Property Value
- MeasuredQuantity
Name1
Meaning of first value.
public string Name1 { get; set; }
Property Value
Name2
Meaning of second value.
public string Name2 { get; set; }
Property Value
PhysicalValue1
The first physical value.
public PhysicalValue PhysicalValue1 { get; }
Property Value
PhysicalValue2
The second physical value.
public PhysicalValue PhysicalValue2 { get; }
Property Value
Value_X
First numerical value.
public double Value_X { get; set; }
Property Value
Value_Y
Second numerical value.
public double Value_Y { get; set; }
Property Value
Values
Gets the pair of values just as vector of two doubles.
public VectorD Values { get; }
Property Value
Methods
ToString()
Overridden ToString function.
public override string ToString()
Returns
- string
The formatted value.
ToString(int)
Gets a string representing this instance.
public string ToString(int numberOfSignificantDigits)
Parameters
numberOfSignificantDigitsintThe number of digits used for formatting of the floating point numbers.
Returns
- string
The formatted value.
ToVectorD()
Returns a VectorD with the values of this pair.
public VectorD ToVectorD()
Returns
Operators
operator ==(PhysicalValuePair, PhysicalValuePair)
Compares two PhysicalValuePair for equality.
public static bool operator ==(PhysicalValuePair pair1, PhysicalValuePair pair2)
Parameters
pair1PhysicalValuePairFirst PhysicalValuePair object to compare.
pair2PhysicalValuePairSecond PhysicalValuePair object to compare.
Returns
- bool
Returns true if the two objects are equal.
implicit operator VectorD?(PhysicalValuePair)
Converts a PhysicalValuePair object into a VectorD object.
public static implicit operator VectorD?(PhysicalValuePair physicalValuePair)
Parameters
physicalValuePairPhysicalValuePairThe VectorD object to convert into a VectorD object.
Returns
- VectorD?
Converted VectorD object. Null if the physicalValuePair is null.
operator !=(PhysicalValuePair, PhysicalValuePair)
Compares two PhysicalValuePair for inequality.
public static bool operator !=(PhysicalValuePair value1, PhysicalValuePair value2)
Parameters
value1PhysicalValuePairFirst PhysicalValuePair object to compare.
value2PhysicalValuePairSecond PhysicalValuePair object to compare.
Returns
- bool
Returns true if the two objects are unequal.