Skip to contents

Cutting-line endpoints for Coombs-mesh plots

Usage

morie_spatial_voting_cutting_lines(normals, cutpoints, xlim = c(-1, 1))

Arguments

normals

(n_votes x n_dims) normal vectors.

cutpoints

Numeric cutpoint offsets.

xlim

Length-2 numeric vector of x-axis limits.

Value

List with endpoints (list of pairs), angles, midpoints, n_lines.

References

Poole KT (2005). Spatial Models of Parliamentary Voting. Cambridge University Press.

Examples

set.seed(1)
morie_spatial_voting_cutting_lines(matrix(rnorm(6), 3, 2), c(0.1, -0.2, 0))
#> $endpoints
#> $endpoints[[1]]
#> $endpoints[[1]][[1]]
#> [1] -1.000000 -0.330007
#> 
#> $endpoints[[1]][[2]]
#> [1] 1.0000000 0.4553768
#> 
#> 
#> $endpoints[[2]]
#> $endpoints[[2]][[1]]
#> [1] -1.00000000 -0.04963973
#> 
#> $endpoints[[2]][[2]]
#> [1]  1.000000 -1.164292
#> 
#> 
#> $endpoints[[3]]
#> $endpoints[[3]][[1]]
#> [1] -1.000000  1.018478
#> 
#> $endpoints[[3]][[2]]
#> [1]  1.000000 -1.018478
#> 
#> 
#> 
#> $angles
#> [1]  111.43953   60.86793 -135.52448
#> 
#> $midpoints
#> $midpoints[[1]]
#> [1] 0.00000000 0.06268489
#> 
#> $midpoints[[2]]
#> [1]  0.000000 -0.606966
#> 
#> $midpoints[[3]]
#> [1] 0 0
#> 
#> 
#> $n_lines
#> [1] 3
#>