CopyXYZs copies an XYZer.
(data XYZer)
| 235 | |
| 236 | // CopyXYZs copies an XYZer. |
| 237 | func CopyXYZs(data XYZer) (XYZs, error) { |
| 238 | if data.Len() == 0 { |
| 239 | return nil, ErrNoData |
| 240 | } |
| 241 | cpy := make(XYZs, 0, data.Len()) |
| 242 | for i := range data.Len() { |
| 243 | x, y, z := data.XYZ(i) |
| 244 | if CheckNaNs(x, y, z) { |
| 245 | continue |
| 246 | } |
| 247 | if err := CheckFloats(x, y, z); err != nil { |
| 248 | return nil, err |
| 249 | } |
| 250 | cpy = append(cpy, XYZ{X: x, Y: y, Z: z}) |
| 251 | } |
| 252 | return cpy, nil |
| 253 | } |
| 254 | |
| 255 | // XYValues implements the XYer interface, returning |
| 256 | // the x and y values from an XYZer. |
nothing calls this directly
no test coverage detected