vector

Having one vector column for multiple text columns on Qdrant

Having one vector column for multiple text columns on Qdrant Question: I have a products table that has a lot of columns, which from these, the following ones are important for our search: Title 1 to Title 6 (title in 6 different languages) Brand name (in 6 different languages) Category name (in 6 different languages) …

Total answers: 2

Direction vector: Correctly scale sin(radians(x)) + cos(radians(z)) with y axis

Direction vector: Correctly scale sin(radians(x)) + cos(radians(z)) with y axis Question: I have an issue with the directional transform math for a voxel raytracer I’m working on in Python. X axis is left-right, Y axis is up-down, Z axis is forward-backward: I calculate view direction from a camera angle stored in degrees, direction being the …

Total answers: 1

how to fit random vector into list of vectors python

how to fit random vector into list of vectors python Question: say I have the following list of vectors vectors=[(10,0),(-10,0),(0,10),(0,-10)] and I have the following random vector: vector=(200,-300) how can I get the vector from the list that is the most similar to the vector that I am inputting in python? Asked By: user2592835 || …

Total answers: 2

Matrix multiplication in numpy vs normal for loop in python

Matrix multiplication in numpy vs normal for loop in python Question: I thought of checking the time difference for a matrix multiplication using numpy matrix multiplication vs normal for loop method. I understand numpy will be faster because of vectorization, but I couldn’t prove it using a simple code like below. I am getting python …

Total answers: 1

Class n dimensional vector

Class n dimensional vector Question: I know how to implement a class for 2n vector. class vect: def __init__(self, *a): self.a = a def plus(self, *plus): res_plus = [vi + wi for vi, wi in zip(self.a, plus)] return res_plus def minus(self, *minus): res_minus = [vi – wi for vi, wi in zip(self.a, minus)] return res_minus …

Total answers: 1

get direction of two points and draw circle at first point

get direction of two points and draw circle at first point Question: Vector s and e are two given points. The goal is to find the direction between this two points and draw a circle at the position of the first point. My current approach looks like this: import bpy import mathutils obj = bpy.data.objects["Plane"] …

Total answers: 1

Create a vector length n with n entries 'x'

Create a vector length n with n entries 'x' Question: Example: n = 5 x = 3.5 Output: array([3.5, 3.5, 3.5, 3.5, 3.5]) My code: import numpy as np def init_all_x(n, x): np.all = [x]*n return np.all init_all_x(5, 3.5) My question: Why init_all_x(5, 3.5).shape cannot run? If my code is wrong, what is the correct …

Total answers: 4