curl --request POST \
--url https://api.iotools.cloud/v1/tool/center-of-gravity-calculator \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"points": "Bracket, 0, 0, 1\nFlange, 1.2, 0.8, 8\nBoss, 2.4, 0.2, 10\nWasher, 1.1, 1.7, 6"
}
'{
"tool": "center-of-gravity-calculator",
"tool_version": "1.0.1",
"outputs": {
"summary": [
{
"metric": "Point Count",
"value": "4"
},
{
"metric": "Total Mass",
"value": "25"
},
{
"metric": "Center of Gravity X",
"value": "1.608"
},
{
"metric": "Center of Gravity Y",
"value": "0.744"
}
],
"breakdown": [
{
"point": "Bracket",
"x": "0",
"y": "0",
"mass": "1",
"of-total-mass": "4%",
"distance-from-cg": "1.77178"
},
{
"point": "Flange",
"x": "1.2",
"y": "0.8",
"mass": "8",
"of-total-mass": "32%",
"distance-from-cg": "0.411825"
},
{
"point": "Boss",
"x": "2.4",
"y": "0.2",
"mass": "10",
"of-total-mass": "40%",
"distance-from-cg": "0.960833"
},
{
"point": "Washer",
"x": "1.1",
"y": "1.7",
"mass": "6",
"of-total-mass": "24%",
"distance-from-cg": "1.08259"
}
],
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"320\" height=\"320\" viewBox=\"0 0 320 320\"><rect width=\"320\" height=\"320\" fill=\"#ffffff\"/><rect x=\"40.00\" y=\"40.00\" width=\"240.00\" height=\"240.00\" fill=\"none\" stroke=\"#e2e2f0\" stroke-width=\"1\"/><line x1=\"67.69\" y1=\"40.00\" x2=\"67.69\" y2=\"280.00\" stroke=\"#e2e2f0\" stroke-width=\"1\" stroke-dasharray=\"3 3\"/><line x1=\"40.00\" y1=\"252.31\" x2=\"280.00\" y2=\"252.31\" stroke=\"#e2e2f0\" stroke-width=\"1\" stroke-dasharray=\"3 3\"/><circle cx=\"67.69\" cy=\"252.31\" r=\"4.60\" fill=\"#464aff\" fill-opacity=\"0.25\" stroke=\"#464aff\" stroke-width=\"1.5\"/><text x=\"67.69\" y=\"243.71\" font-size=\"10\" text-anchor=\"middle\" fill=\"#464aff\" font-weight=\"600\">1</text><circle cx=\"160.00\" cy=\"165.43\" r=\"8.80\" fill=\"#464aff\" fill-opacity=\"0.25\" stroke=\"#464aff\" stroke-width=\"1.5\"/><text x=\"160.00\" y=\"152.63\" font-size=\"10\" text-anchor=\"middle\" fill=\"#464aff\" font-weight=\"600\">2</text><circle cx=\"252.31\" cy=\"230.59\" r=\"10.00\" fill=\"#464aff\" fill-opacity=\"0.25\" stroke=\"#464aff\" stroke-width=\"1.5\"/><text x=\"252.31\" y=\"216.59\" font-size=\"10\" text-anchor=\"middle\" fill=\"#464aff\" font-weight=\"600\">3</text><circle cx=\"152.31\" cy=\"67.69\" r=\"7.60\" fill=\"#464aff\" fill-opacity=\"0.25\" stroke=\"#464aff\" stroke-width=\"1.5\"/><text x=\"152.31\" y=\"56.09\" font-size=\"10\" text-anchor=\"middle\" fill=\"#464aff\" font-weight=\"600\">4</text><line x1=\"182.38\" y1=\"171.51\" x2=\"200.38\" y2=\"171.51\" stroke=\"#ff6b6b\" stroke-width=\"2\"/><line x1=\"191.38\" y1=\"162.51\" x2=\"191.38\" y2=\"180.51\" stroke=\"#ff6b6b\" stroke-width=\"2\"/><circle cx=\"191.38\" cy=\"171.51\" r=\"4\" fill=\"#ffffff\" stroke=\"#ff6b6b\" stroke-width=\"2\"/><text x=\"191.38\" y=\"156.51\" font-size=\"11\" text-anchor=\"middle\" fill=\"#ff6b6b\" font-weight=\"700\">CG</text></svg>"
},
"credits_used": 3,
"credits_remaining": null
}Calculators
Center of Gravity Calculator
Calculate the weighted center of gravity (centroid) of a set of point masses. Enter each point as X, Y, Mass (label optional, negative mass for a cutout) — get the total mass, the CG coordinates, a per-point contribution breakdown, and a plotted diagram.
POST
/
v1
/
tool
/
center-of-gravity-calculator
curl --request POST \
--url https://api.iotools.cloud/v1/tool/center-of-gravity-calculator \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"points": "Bracket, 0, 0, 1\nFlange, 1.2, 0.8, 8\nBoss, 2.4, 0.2, 10\nWasher, 1.1, 1.7, 6"
}
'{
"tool": "center-of-gravity-calculator",
"tool_version": "1.0.1",
"outputs": {
"summary": [
{
"metric": "Point Count",
"value": "4"
},
{
"metric": "Total Mass",
"value": "25"
},
{
"metric": "Center of Gravity X",
"value": "1.608"
},
{
"metric": "Center of Gravity Y",
"value": "0.744"
}
],
"breakdown": [
{
"point": "Bracket",
"x": "0",
"y": "0",
"mass": "1",
"of-total-mass": "4%",
"distance-from-cg": "1.77178"
},
{
"point": "Flange",
"x": "1.2",
"y": "0.8",
"mass": "8",
"of-total-mass": "32%",
"distance-from-cg": "0.411825"
},
{
"point": "Boss",
"x": "2.4",
"y": "0.2",
"mass": "10",
"of-total-mass": "40%",
"distance-from-cg": "0.960833"
},
{
"point": "Washer",
"x": "1.1",
"y": "1.7",
"mass": "6",
"of-total-mass": "24%",
"distance-from-cg": "1.08259"
}
],
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"320\" height=\"320\" viewBox=\"0 0 320 320\"><rect width=\"320\" height=\"320\" fill=\"#ffffff\"/><rect x=\"40.00\" y=\"40.00\" width=\"240.00\" height=\"240.00\" fill=\"none\" stroke=\"#e2e2f0\" stroke-width=\"1\"/><line x1=\"67.69\" y1=\"40.00\" x2=\"67.69\" y2=\"280.00\" stroke=\"#e2e2f0\" stroke-width=\"1\" stroke-dasharray=\"3 3\"/><line x1=\"40.00\" y1=\"252.31\" x2=\"280.00\" y2=\"252.31\" stroke=\"#e2e2f0\" stroke-width=\"1\" stroke-dasharray=\"3 3\"/><circle cx=\"67.69\" cy=\"252.31\" r=\"4.60\" fill=\"#464aff\" fill-opacity=\"0.25\" stroke=\"#464aff\" stroke-width=\"1.5\"/><text x=\"67.69\" y=\"243.71\" font-size=\"10\" text-anchor=\"middle\" fill=\"#464aff\" font-weight=\"600\">1</text><circle cx=\"160.00\" cy=\"165.43\" r=\"8.80\" fill=\"#464aff\" fill-opacity=\"0.25\" stroke=\"#464aff\" stroke-width=\"1.5\"/><text x=\"160.00\" y=\"152.63\" font-size=\"10\" text-anchor=\"middle\" fill=\"#464aff\" font-weight=\"600\">2</text><circle cx=\"252.31\" cy=\"230.59\" r=\"10.00\" fill=\"#464aff\" fill-opacity=\"0.25\" stroke=\"#464aff\" stroke-width=\"1.5\"/><text x=\"252.31\" y=\"216.59\" font-size=\"10\" text-anchor=\"middle\" fill=\"#464aff\" font-weight=\"600\">3</text><circle cx=\"152.31\" cy=\"67.69\" r=\"7.60\" fill=\"#464aff\" fill-opacity=\"0.25\" stroke=\"#464aff\" stroke-width=\"1.5\"/><text x=\"152.31\" y=\"56.09\" font-size=\"10\" text-anchor=\"middle\" fill=\"#464aff\" font-weight=\"600\">4</text><line x1=\"182.38\" y1=\"171.51\" x2=\"200.38\" y2=\"171.51\" stroke=\"#ff6b6b\" stroke-width=\"2\"/><line x1=\"191.38\" y1=\"162.51\" x2=\"191.38\" y2=\"180.51\" stroke=\"#ff6b6b\" stroke-width=\"2\"/><circle cx=\"191.38\" cy=\"171.51\" r=\"4\" fill=\"#ffffff\" stroke=\"#ff6b6b\" stroke-width=\"2\"/><text x=\"191.38\" y=\"156.51\" font-size=\"11\" text-anchor=\"middle\" fill=\"#ff6b6b\" font-weight=\"700\">CG</text></svg>"
},
"credits_used": 3,
"credits_remaining": null
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Points (Label, X, Y, Mass)
Response
Tool output
Show child attributes
Show child attributes
The tool's slug, echoing the {slug} in the request path.
Output-contract version for this tool.
Credits this call consumed, after any settlement refund. 0 when metering is disabled.
Credits left in the current monthly allowance, or null when metering is disabled.
Correlation id, also sent as x-request-id.
Was this page helpful?
⌘I