MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / sampleByNumber

Method sampleByNumber

src/main/java/field/graphics/FLine.java:568–576  ·  view source on GitHub ↗

returns a list of `Vec3` (i.e. positions) by repeatedly moving along the line in `steps`; the beginning and end of the line will be in this list.

(int steps)

Source from the content-addressed store, hash-verified

566 r.add(c.position());
567 }
568 return r;
569 }
570
571
572 /**
573 * calls function 'fun' with a parameter that goes from 0 -> 1 (inclusive) in 'samples' steps. Then hands the results to `data('t*', ...)`
574 */
575 public FLine fromSampling(Function<Double, Object> fun, int samples) {
576 List<Object> rr = new ArrayList<Object>();
577 for (int i = 0; i < samples; i++) {
578 double alpha = i / (samples - 1f);
579 Object o = fun.apply(alpha);

Callers

nothing calls this directly

Calls 5

cursorMethod · 0.95
setDMethod · 0.80
lengthDMethod · 0.80
positionMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected