public static Element drawCross ( SVGPlot svgp , Projection2D proj , NumberVector mid , double radius ) { final double [ ] v_mid = mid . toArray ( ) ; final long [ ] dims = proj . getVisibleDimensions2D ( ) ; SVGPath path = new SVGPath ( ) ; for ( int dim = BitsUtil . nextSetBit ( dims , 0 ) ; dim >= 0 ; dim = BitsUtil . nextSetBit ( dims , dim + 1 ) ) { v_mid [ dim ] += radius ; double [ ] p1 = proj . fastProjectDataToRenderSpace ( v_mid ) ; v_mid [ dim ] -= radius * 2 ; double [ ] p2 = proj . fastProjectDataToRenderSpace ( v_mid ) ; v_mid [ dim ] += radius ; path . moveTo ( p1 [ 0 ] , p1 [ 1 ] ) . drawTo ( p2 [ 0 ] , p2 [ 1 ] ) . close ( ) ; } return path . makeElement ( svgp ) ; }
Wireframe cross hypersphere