Skip to main content

layout_random_3d

Function layout_random_3d 

Source
pub fn layout_random_3d(graph: &Graph, seed: u64) -> Vec<(f64, f64, f64)>
Expand description

Place vertices uniformly at random in the cube [-1, 1]³.

Returns a Vec of (x, y, z) coordinate triples, one per vertex.

§Examples

use rust_igraph::{Graph, layout_random_3d};

let g = Graph::with_vertices(5);
let coords = layout_random_3d(&g, 42);
assert_eq!(coords.len(), 5);