Skip to content

Commit

Permalink
SecBuildH関数で単位質量の算定を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
st-func committed Feb 12, 2024
1 parent 2689926 commit 7704150
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/functions/functions.test.ts
Expand Up @@ -2,6 +2,7 @@ import { secBuildH } from "./functions";

test("ビルドH", () => {
expect(secBuildH("A", 1200, 400, 19, 25)).toBe(41850.0);
expect(secBuildH("m", 1200, 400, 19, 25)).toBe(328.5225);
expect(secBuildH("Iy", 1200, 400, 19, 25)).toBeCloseTo(9312218750.0, 5);
expect(secBuildH("Iz", 1200, 400, 19, 25)).toBeCloseTo(267323987.5, 6);
});
4 changes: 4 additions & 0 deletions src/functions/functions.ts
Expand Up @@ -8,6 +8,8 @@ function toSectionPropertyType(propertyType: string): SectionPropertyType {
switch (propertyType) {
case "A":
return SectionPropertyType.Area;
case "m":
return SectionPropertyType.MassPerMetre;
case "Iy":
return SectionPropertyType.SecondMomentOfAreaY;
case "Iz":
Expand All @@ -28,6 +30,8 @@ function unitOfSectionPropertyType(propertyType: SectionPropertyType): string {
case SectionPropertyType.SecondMomentOfAreaY:
case SectionPropertyType.SecondMomentOfAreaZ:
return "mm^4";
case SectionPropertyType.MassPerMetre:
return "kg/m";
}
}

Expand Down

0 comments on commit 7704150

Please sign in to comment.