Calculate Centroid of Vectors
detail.loadingPreview
Calculates the geometric centroid of a set of input vectors.
About This Workflow
This workflow accepts a set of vectors via a webhook, validates their dimensions, calculates their geometric centroid, and returns the result. It's useful for scenarios where you need to find the average point or center of a collection of numerical data points represented as vectors.
Key Features
- Accepts vectors via a webhook.
- Validates that all input vectors have consistent dimensions.
- Computes the centroid by averaging each dimension across all vectors.
- Returns the calculated centroid or an error message if validation fails.
How To Use
- Trigger Workflow: Send a GET request to the webhook URL configured in the
Receive Vectorsnode. The request must include avectorsquery parameter containing a JSON array of vectors. For example:GET /centroid?vectors=[[2,3,4],[4,5,6],[6,7,8]] - Data Processing: The
Extract & Parse Vectorsnode will parse thevectorsparameter. TheValidate & Compute Centroidnode will then validate the input and calculate the centroid. - Receive Response: The
Return Centroid Responsenode will send the calculated centroid (e.g.,{"centroid": [4,5,6]}) or an error message back to the client.
Apps Used
Workflow JSON
{
"id": "5c0d1d5f-65dd-4c19-b4c9-5b3935de0057",
"name": "Calculate Centroid of Vectors",
"nodes": 27,
"category": "Math & Data",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 5c0d1d5f-65dd...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Automate Local Business Outreach with AI-Powered Yelp Scraper
This workflow automates the process of scraping local business details from Yelp using AI, then leverages that data to send personalized partnership proposals via Gmail. It's perfect for sales and marketing teams looking to streamline lead generation and outreach campaigns.
Automate Getty Images Editorial Search & CMS Integration
This n8n workflow automates searching for editorial images on Getty Images, extracts key details and embed codes, and prepares them for seamless integration into your Content Management System (CMS), streamlining your content creation process.
Universal CSV to JSON API Converter
Effortlessly transform CSV data into structured JSON with this versatile n8n workflow. Integrate it into any application as a custom API endpoint, supporting various input methods including file uploads and raw text.