Updating copyrights, fixing bugs related to non continuous domains.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Ad5001 2022-01-12 18:47:17 +01:00
parent 492e715f00
commit be8e7361aa
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
22 changed files with 26 additions and 24 deletions

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -135,16 +135,18 @@ class Function extends Common.ExecutableObject {
var previousY; var previousY;
if(definitionDomain instanceof MathLib.SpecialDomain && definitionDomain.moveSupported) { if(definitionDomain instanceof MathLib.SpecialDomain && definitionDomain.moveSupported) {
// Point based functions. // Point based functions.
previousX = definitionDomain.previous(previousX) previousX = definitionDomain.next(previousX)
if(previousX === null) previousX = definitionDomain.next(canvas.px2x(0)) if(previousX === null) previousX = definitionDomain.next(canvas.px2x(0))
previousY = expr.execute(previousX) previousY = expr.execute(previousX)
if(!drawPoints && !drawDash) return if(!drawPoints && !drawDash) return
while(previousX !== null && canvas.x2px(previousX) < canvas.canvasSize.width) { while(previousX !== null && canvas.x2px(previousX) < canvas.canvasSize.width) {
var currentX = definitionDomain.next(previousX) // Reconverted for canvas to fix for logarithmic scales.
var currentX = definitionDomain.next(canvas.px2x(canvas.x2px(previousX)+pxprecision));
var currentY = expr.execute(currentX) var currentY = expr.execute(currentX)
if(currentX === null) break; if(currentX === null) break;
if((definitionDomain.includes(currentX) || definitionDomain.includes(previousX)) && if((definitionDomain.includes(currentX) || definitionDomain.includes(previousX)) &&
(destinationDomain.includes(currentY) || destinationDomain.includes(previousY))) { (destinationDomain.includes(currentY) || destinationDomain.includes(previousY))) {
console.log(drawDash, drawPoints)
if(drawDash) if(drawDash)
canvas.drawDashedLine(ctx, canvas.x2px(previousX), canvas.y2px(previousY), canvas.x2px(currentX), canvas.y2px(currentY)) canvas.drawDashedLine(ctx, canvas.x2px(previousX), canvas.y2px(previousY), canvas.x2px(currentX), canvas.y2px(currentY))
if(drawPoints) { if(drawPoints) {

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
/** /**
* LogarithmPlotter - Create graphs with logarithm scales. * LogarithmPlotter - Create graphs with logarithm scales.
* Copyright (C) 2021 Ad5001 * Copyright (C) 2022 Ad5001
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by