//MomentOfInertia.h #ifdef COMPILE_MYLIBRARY #define DllExport __declspec( dllexport ) #else #define DllExport __declspec( dllimport ) #endif class DllExport a { public: double MOIRectangle(double b, double h); double MOISemiCircle(double r); double MOITriangle(double b, double h, int); };
// MomentOfInertia.cpp : #include "stdafx.h" // Calculation of the moment of inertia #include "MomentOfInertia.h" double a::MOIRectangle(double b, double h) { return b * h * h * h / 3; } double a::MOISemiCircle(double r) { const double PI = 3.14159; return r * r * r * r * PI / 8; } double a::MOITriangle(double b, double h, int) { return b * h * h * h / 12; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)