public PhongMaterial(Color color, UDouble ambience, UDouble diffusion, UDouble specularity, UDouble shininess) { Color = color; _ambience = ambience; _diffusion = diffusion; _specularity = specularity; _shininess = shininess; }
public UDouble Clamp(UDouble maximum, UDouble minimum = default) => value > maximum ? maximum : (value < minimum ? minimum : value);
public static void Main() { UDouble max = new UDouble(Double.MaxValue); UDouble neg = new UDouble(-3.0); }
public static float ToSingle(UDouble value) { return((float)value); }
public static Double ToDouble(UDouble value) { return((Double)value); }
/// <summary> /// Parses <see cref="string"/> to <see cref="UDouble"/>. /// </summary> public static UDouble ToUDouble(this string value) { UDouble.TryParse(value, out UDouble result); return(result); }
public static bool Within(this UDouble input, UDouble minimum, UDouble maximum) => input >= minimum && input <= maximum;
public static UDouble Coerce(this UDouble value, UDouble maximum, UDouble minimum) => value > maximum ? maximum : (value < minimum ? minimum : value);