Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Building Blocks & Utilities

Building Blocks & Utilities

Calculate the Centroid of Vectors via Webhook

When a webhook receives a set of vectors, it validates them, computes their centroid and returns the result.

What it does

📌 Description: This node performs vector validation and centroid computation. - Validation: Ensures all vectors have the same number of dimensions. - Computation: Averages each dimension to determine the centroid. - If validation fails: Returns an error message indicating inconsistent dimensions. 🔹 Successful Output Example: json { "centroid": [4,5,6] } 🔹 Error Output Example: json { "error": "Vectors have inconsistent dimensions." }

The steps

  1. Receive Vectors
  2. Extract & Parse Vectors
  3. Validate & Compute Centroid
  4. Return Centroid Response

Similar automations