1 package org.djunits.demo.website;
2
3 import org.djunits.unit.LengthUnit;
4 import org.djunits.value.StorageType;
5 import org.djunits.value.ValueException;
6 import org.djunits.value.vdouble.matrix.LengthMatrix;
7 import org.djunits.value.vdouble.matrix.MutableLengthMatrix;
8 import org.djunits.value.vdouble.scalar.DoubleScalar;
9 import org.djunits.value.vdouble.vector.DoubleVector;
10
11
12
13
14
15
16
17
18
19
20
21
22 public class Test
23 {
24
25
26
27
28
29 public static void main(final String[] args) throws ValueException
30 {
31 DoubleScalar.Rel<JerkUnit> jerk1 = new DoubleScalar.Rel<>(1.2, JerkUnit.SI);
32 DoubleScalar.Rel<JerkUnit> jerk2 = jerk1.multiplyBy(2.0);
33 double[] sv = new double[] { 1, 2, 3, 4, 5 };
34 DoubleVector.Rel<JerkUnit> jerkVector = new DoubleVector.Rel<JerkUnit>(sv, JerkUnit.SI, StorageType.DENSE);
35
36 Jerk jjerk1 = new Jerk(1.2, JerkUnit.SI);
37 Jerk jjerk2 = jjerk1.multiplyBy(2.0);
38
39 double[][] data = new double[1000][1000];
40 for (int i=0; i<1000; i++) { for (int j=0; j<1000; j++) {data[i][j] = 9*i + 2*j * 0.364; }}
41 MutableLengthMatrix lengthMatrix = new MutableLengthMatrix(data, LengthUnit.CENTIMETER, StorageType.DENSE);
42 lengthMatrix.round();
43 }
44
45 }