geometric-props
v1.0.2
Published
Class for calculating the geometric properties values of two-dimensional polygonal figures
Downloads
13
Maintainers
Readme
Note: The units provided in the table are valid when entering the coordinates of the polygonal figure in centimeters (cm).
| Geometric Propertie | Acronym | Unit | | :--- | :---: | :---: | | Section area | A | cm² | | Static moment with respect to the x-axis | Sx | cm³ | | Static moment with respect to the y-axis | Sy | cm³ | | Moment of inertia with respect to the x-axis | Ix | cm⁴ | | Moment of inertia with respect to the y-axis | Iy | cm⁴ | | Product of inertia with respect to the x and y axes | Ixy | cm⁴ | | Centroid of the section relative to the x-axis | xg | cm | | Centroid of the section relative to the y-axis | yg | cm | | Barycentric moment of inertia (with respect to the centroid) on the x-axis | Ixg | cm⁴ | | Barycentric moment of inertia (with respect to the centroid) on the y-axis | Iyg | cm⁴ | | Vertical distance between the center of gravity and the lowest point along the vertical axis | Y1 | cm | | Vertical distance between the highest point along the vertical axis and the center of gravity | Y2 | cm | | Resistant modulus, calculated considering Y1 | W1 | cm³ | | Resistant modulus, calculated considering Y2 | W2 | cm³ | | Height | height | cm |
| Information | Acronym | Unit | | :--- | :---: | :---: | | Maximum coordinate with respect to the x axis | xmax | cm² | | Minimum coordinate with respect to the x axis | xmin | cm | | Maximum coordinate with respect to the y axis | ymax | cm | | Minimum coordinate with respect to the x axis | ymin | cm |
import GeometricProps from "geometric-props";
In the following case, we want to represent a rectangular figure with a base of 20cm and a height of 60cm, where the lower left corner is located at coordinates (0,0). The following table and figure represent the situation in question:
| Point | Coordinate on x axis | Coordinate on y axis | | :---: | :---: | :---: | | 1 | 0 | 0 | | 2 | 20 | 0 | | 3 | 20 | 60 | | 4 | 0 | 60 | | 5 | 0 | 0 |
const rectangulo = new GeometricProps(
[
{'x':0, 'y':0}, ##ponto 1
{'x':20, 'y':0}, ##ponto 2
{'x':20, 'y':60}, ##ponto 3
{'x':0, 'y':60}, ##ponto 4
{'x':0, 'y':0} ##ponto 5
])
console.log(`
Xmax: ${rectangulo.Xmax.toFixed(2)} cm,
Xmin: ${rectangulo.Xmin.toFixed(2)} cm,
Ymax: ${rectangulo.Ymax.toFixed(2)} cm,
Ymin: ${rectangulo.Ymin.toFixed(2)} cm,
A: ${rectangulo.A.toFixed(2)} cm²,
Sx: ${rectangulo.Sx.toFixed(2)} cm³,
Sy: ${rectangulo.Sy.toFixed(2)} cm³,
Ix: ${rectangulo.Ix.toFixed(2)} cm⁴,
Iy: ${rectangulo.Iy.toFixed(2)} cm⁴,
Ixy: ${rectangulo.Ixy.toFixed(2)} cm⁴,
Xg: ${rectangulo.Xg.toFixed(2)} cm,
Yg: ${rectangulo.Yg.toFixed(2)} cm,
Ixg: ${rectangulo.Ixg.toFixed(2)} cm⁴,
Iyg: ${rectangulo.Iyg.toFixed(2)} cm⁴,
Ixyg: ${rectangulo.Ixyg.toFixed(2)} cm⁴,
Y1: ${rectangulo.Y1.toFixed(2)} cm,
Y2: ${rectangulo.Y2.toFixed(2)} cm,
W1: ${rectangulo.W1.toFixed(2)} cm³,
W2: ${rectangulo.W2.toFixed(2)} cm³,
height: ${rectangulo.height.toFixed(2)} cm,
base: ${rectangulo.base.toFixed(2)} cm,
`)
A partir dessa seção, será apresentada a documentação do projeto em português (pt-br).
Observação: As unidades disponibilizadas na tabela são válidas quando se insere as coordenadas da figura poligonal em centímetros (cm).
| Propriedades Geométricas | Sigla | Unidade | | :--- | :---: | :---: | | Área da seção | A | cm² | | Momento estático com relação ao eixo x | Sx | cm³ | | Momento estático com relação ao eixo y | Sy | cm³ | | Momento de inércia com relação ao eixo x | Ix | cm⁴ | | Momento de inércia com relação ao eixo y | Iy | cm⁴ | | Produto da inércia em relação aos eixos x e y | Ixy | cm⁴ | | Centróide da seção em relação ao eixo x | xg | cm | | Centróide da seção em relação ao eixo y | yg | cm | | Momento de inércia baricêntrica (com relação ao centróide) no eixo x | Ixg | cm⁴ | | Momento de inércia baricêntrica (com relação ao centróide) no eixo x | Ixg | cm⁴ | | Distância vertical entre o centro de gravidade e o ponto mais baixo ao longo do eixo vertical | Y1 | cm | | Distância vertical entre o ponto mais alto ao longo do eixo vertical e o centro de gravidade | Y2 | cm | | Módulo resistente, calculado considerando Y1 | W1 | cm³ | | Módulo resistente, calculado considerando Y2 | W2 | cm³ | | Altura | height | cm |
| Informação | Sigla | Unidade | | :--- | :---: | :---: | | Coordenada máxima com relação ao eixo x | xmax | cm² | | Coordenada mínima com relação ao eixo x | xmin | cm | | Coordenada máxima com relação ao eixo y | ymax | cm | | Coordenada mínima com relação ao eixo y | ymin | cm |
import GeometricProps from "geometric-props";
No caso a seguir, queremos representar uma figura retangular com base de 20cm e altura de 60cm, em que a quina inferior esquerda está situada nas coordenadas (0,0). A tabela e a figura a seguir, representam a situação em questão:
| Ponto | Coordenada no eixo x | Coordenada no eixo y | | :---: | :---: | :---: | | 1 | 0 | 0 | | 2 | 20 | 0 | | 3 | 20 | 60 | | 4 | 0 | 60 | | 5 | 0 | 0 |
const rectangulo = new GeometricProps(
[
{'x':0, 'y':0}, //ponto 1
{'x':20, 'y':0}, //ponto 2
{'x':20, 'y':60}, //ponto 3
{'x':0, 'y':60}, //ponto 4
{'x':0, 'y':0} //ponto 5
])
console.log(`
Xmax: ${rectangulo.Xmax.toFixed(2)} cm,
Xmin: ${rectangulo.Xmin.toFixed(2)} cm,
Ymax: ${rectangulo.Ymax.toFixed(2)} cm,
Ymin: ${rectangulo.Ymin.toFixed(2)} cm,
A: ${rectangulo.A.toFixed(2)} cm²,
Sx: ${rectangulo.Sx.toFixed(2)} cm³,
Sy: ${rectangulo.Sy.toFixed(2)} cm³,
Ix: ${rectangulo.Ix.toFixed(2)} cm⁴,
Iy: ${rectangulo.Iy.toFixed(2)} cm⁴,
Ixy: ${rectangulo.Ixy.toFixed(2)} cm⁴,
Xg: ${rectangulo.Xg.toFixed(2)} cm,
Yg: ${rectangulo.Yg.toFixed(2)} cm,
Ixg: ${rectangulo.Ixg.toFixed(2)} cm⁴,
Iyg: ${rectangulo.Iyg.toFixed(2)} cm⁴,
Ixyg: ${rectangulo.Ixyg.toFixed(2)} cm⁴,
Y1: ${rectangulo.Y1.toFixed(2)} cm,
Y2: ${rectangulo.Y2.toFixed(2)} cm,
W1: ${rectangulo.W1.toFixed(2)} cm³,
W2: ${rectangulo.W2.toFixed(2)} cm³,
height: ${rectangulo.height.toFixed(2)} cm,
base: ${rectangulo.base.toFixed(2)} cm,
`)