# Vector Functions

- [VEC\_DISTANCE](https://mariadb.com/docs/server/reference/sql-functions/vector-functions/vector-functions-vec_distance.md): Calculate distance between vectors. This function computes the distance between two vectors using either Euclidean or Cosine metric, depending on the index.
- [VEC\_DISTANCE\_COSINE](https://mariadb.com/docs/server/reference/sql-functions/vector-functions/vec_distance_cosine.md): Calculate Cosine distance. This function computes the Cosine distance between two vectors, measuring the cosine of the angle between them.
- [VEC\_DISTANCE\_EUCLIDEAN](https://mariadb.com/docs/server/reference/sql-functions/vector-functions/vec_distance_euclidean.md): Calculate Euclidean distance. This function computes the Euclidean (L2) distance between two vectors, representing the straight-line distance.
- [VEC\_FromText](https://mariadb.com/docs/server/reference/sql-functions/vector-functions/vec_fromtext.md): Convert text to vector. This function parses a JSON array string representation of a vector and converts it into the binary VECTOR data type.
- [VEC\_ToText](https://mariadb.com/docs/server/reference/sql-functions/vector-functions/vec_totext.md): Convert vector to text. This function takes a binary VECTOR data type and returns its JSON array string representation.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/sql-functions/vector-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
