MCPcopy Create free account
hub / github.com/KDE/labplot / maplog10XYToCartesian

Method maplog10XYToCartesian

tests/backend/Datapicker/DatapickerTest.cpp:261–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261void DatapickerTest::maplog10XYToCartesian() {
262 DatapickerImage::ReferencePoints points;
263 points.type = DatapickerImage::GraphType::Log10XY;
264 points.logicalPos[0].setX(pow(10, 5));
265 points.logicalPos[0].setY(pow(10, 1));
266 points.logicalPos[1].setX(pow(10, 6));
267 points.logicalPos[1].setY(pow(10, 2));
268 points.logicalPos[2].setX(pow(10, 7));
269 points.logicalPos[2].setY(pow(10, 3));
270 points.scenePos[0].setX(6.21);
271 points.scenePos[0].setY(7.23);
272 points.scenePos[1].setX(-51.2);
273 points.scenePos[1].setY(3234);
274 points.scenePos[2].setX(-23);
275 points.scenePos[2].setY(+5e6);
276
277 Transform t;
278 QCOMPARE(t.mapTypeToCartesian(points), true);
279 VALUES_EQUAL(t.x[0], 5.);
280 VALUES_EQUAL(t.y[0], 1.);
281 VALUES_EQUAL(t.x[1], 6.);
282 VALUES_EQUAL(t.y[1], 2.);
283 VALUES_EQUAL(t.x[2], 7.);
284 VALUES_EQUAL(t.y[2], 3.);
285 VALUES_EQUAL(t.X[0], 6.21);
286 VALUES_EQUAL(t.Y[0], 7.23);
287 VALUES_EQUAL(t.X[1], -51.2);
288 VALUES_EQUAL(t.Y[1], 3234.);
289 VALUES_EQUAL(t.X[2], -23.);
290 VALUES_EQUAL(t.Y[2], +5.e6);
291}
292
293void DatapickerTest::mapPolarInRadiansToCartesian() {
294 DatapickerImage::ReferencePoints points;

Callers

nothing calls this directly

Calls 3

setXMethod · 0.80
setYMethod · 0.80
mapTypeToCartesianMethod · 0.80

Tested by

no test coverage detected