Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 7f7b082b authored by Michael KRISPER's avatar Michael KRISPER
Browse files

added operators for si type conversions

parent 339f2c96
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SIMPLE_EMBEDDED_STATEMENT_STYLE/@EntryValue">LINE_BREAK</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SI/@EntryIndexedValue">SI</s:String>
<s:Boolean x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=2BF7A1E51991F2458D2D1F0B29CF888B/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=2BF7A1E51991F2458D2D1F0B29CF888B/AbsolutePath/@EntryValue">C:\Workspaces\VisualStudio\VECTO_quam\VECTO.sln.DotSettings</s:String>
<s:Boolean x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File2BF7A1E51991F2458D2D1F0B29CF888B/@KeyIndexDefined">True</s:Boolean>
......
namespace TUGraz.VectoCore.Utils
{
public static class Formulas
{
/// <summary>
/// [Nm], [rad/s] => [W]. Calculates the power from torque and angular velocity.
/// </summary>
/// <param name="torque">[Nm]</param>
/// <param name="angularFrequency">[rad/s]</param>
/// <returns>power [W]</returns>
public static Watt TorqueToPower(NewtonMeter torque, RadianPerSecond angularFrequency)
{
return (torque * angularFrequency).As<Watt>();
}
public static class Formulas
{
/// <summary>
/// [Nm], [rad/s] => [W]. Calculates the power from torque and angular velocity.
/// </summary>
/// <param name="torque">[Nm]</param>
/// <param name="angularFrequency">[rad/s]</param>
/// <returns>power [W]</returns>
public static Watt TorqueToPower(NewtonMeter torque, RadianPerSecond angularFrequency)
{
return torque * angularFrequency;
}
/// <summary>
/// [W], [rad/s] => [Nm]. Calculates the torque from power and angular velocity.
/// </summary>
/// <param name="power">[W]</param>
/// <param name="angularFrequency">[rad/s]</param>
/// <returns>torque [Nm]</returns>
public static NewtonMeter PowerToTorque(Watt power, RadianPerSecond angularFrequency)
{
return (power / angularFrequency).As<NewtonMeter>();
}
}
/// <summary>
/// [W], [rad/s] => [Nm]. Calculates the torque from power and angular velocity.
/// </summary>
/// <param name="power">[W]</param>
/// <param name="angularFrequency">[rad/s]</param>
/// <returns>torque [Nm]</returns>
public static NewtonMeter PowerToTorque(Watt power, RadianPerSecond angularFrequency)
{
return power / angularFrequency;
}
}
}
\ No newline at end of file
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment