Questions tagged [nalgebra]
nalgebra is a linear algebra library written for Rust
7
questions
2
votes
1answer
81 views
Why is Rust unable to figure out the correct `from_iterator` to use when constructing a nalgebra::MatrixN?
I have a struct defined as:
use nalgebra::{
allocator::Allocator, DefaultAllocator, Dim, DimName, MatrixN, RowVectorN, VectorN, U1,
}; // 0.22.0
pub struct Filter<Order: Dim + DimName>
...
1
vote
1answer
61 views
How do I get a (1.0, 1.0, 1.0) Vector3 from the nalgebra crate?
I'm trying to create a Vector3 from the nalgebra crate with components (1.0, 1.0, 1.0). I can't find what I need from the documentation, and my IDE's suggestions don't help.
1
vote
1answer
159 views
How to convert from nalgebra::Matrix to Eigen::MatrixXf correctly?
I have a DLL written in C++ and I need to call a function called print_matrix(Eigen::MatrixXf *m) from a Rust program.
I created the a 4x3 mactrix and the function in question takes a pointer as its ...
1
vote
1answer
197 views
nalgebra: Implementing a function for a generic MatrixMN
I'm trying to implement the exp function for a generic square MatrixMN
pub fn exp<N, R>(m: &MatrixMN<N, R, R>, k: usize) -> MatrixMN<N, R, R>
where
N: Scalar + One + Zero,...
0
votes
1answer
94 views
How to average two points in nalgebra?
I have a triangle ABC, and I want to generate triangle DEF.
Triangle DEF is created using the centre of all edges of ABC. Nalgebra doesn't seem to allow me to do add points together, only vectors.
...
0
votes
0answers
243 views
How do I rotate an object so that it's always facing the mouse position?
I'm using ggez to make a game with some friends, and I'm trying to have our character rotate to face the pointer at all times. I know so far that I need to get an angle value (f32) in radians, and I ...
0
votes
2answers
198 views
Is there a good way to do an overlapping copy in ndarray in rust?
Here's what I tried
use ndarray::{arr2, s};
let mut a = arr2(&[[1, 2, 3],
[4, 5, 6]]);
let b = arr2(&[[2, 3, 3],
[5, 6, 6]]);
a.slice_mut(s![.., ..2])....