ERLEDIGT
NEIN
NEIN
ANTWORTEN
0
0
ZUGRIFFE
460
460
EMPFEHLEN
-
Hallo zusammen,
ich das Problem, dass ich keinen Sinusverlauf mit sich linear ändernder (kleiner werdender) Frequenz hinbekomme.
Beginnen soll es mit 236px und einer Periode und dann linear bis zu einer Pixel 2360 immer kleiner werden.
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
import ij.*; import ij.plugin.*; import ij.process.*; import ij.ImagePlus; import ij.plugin.PlugIn; import ij.process.ImageProcessor; import ij.gui.*; import java.awt.*; public class Sinusverlauf_6 implements PlugIn{ int width = 7016; int height = (int) (width/1.414); public void run(String arg){ ImagePlus myImPlus = IJ.createImage("Sinusverlauf_6", "8-bit", width, height, 1); ImageProcessor ip = myImPlus.getProcessor(); double a = 255.0/2; double p = 236; double c = 1; double d = 255.0/2; // funkioniert ---------------------------------------------- for (double i = 0; i <= 236; i+=0.1) { double wert2 =a*Math.sin((2*Math.PI/p)*i+Math.PI/c)+d; int sin2 = (int) wert2; Rectangle roib = ip.getRoi(); ip.setRoi(roib); ip.setRoi((int)i,0 , 1,472); ip.setValue(sin2); ip.fill(); ip.putPixel((int)i,sin2+600 , 0); } // funktioniert nicht ------------------------------------------------ double length = 2360; double small = 236; double periods = (length/small)+1; for (double i = 0; i <= length; i +=0.1){ for (int j = 0; j < periods; j++) { double wert2 =a*Math.sin((2*Math.PI*j/length)*i+Math.PI/c)+d; int sin2 = (int) wert2; Rectangle roib = ip.getRoi(); ip.setRoi(roib); ip.setRoi((int)i,950 , 1,472); ip.setValue(sin2); ip.fill(); ip.putPixel((int)i,sin2+1800 , 0); } } myImPlus.show(); } }
Das ist einer meiner Versuche.
Die einzelnen Frequenzen werden zwar gezeichnet aber alle übereinander und der S/W Verlauf zeigt auch nur eine Frequenz.
Gruß
Ähnliche Themen
-
CPU Frequenz auslesen
Von muater im Forum .NET CaféAntworten: 0Letzter Beitrag: 13.03.09, 14:23 -
Wie stelle ich die CPU Frequenz ein?
Von alphadog im Forum HardwareAntworten: 5Letzter Beitrag: 01.02.09, 01:07 -
frequenz der worte
Von shysdrag im Forum C/C++Antworten: 1Letzter Beitrag: 23.12.05, 16:55 -
Monitor Frequenz
Von Pherseus im Forum Linux & UnixAntworten: 1Letzter Beitrag: 15.11.05, 00:21 -
Frequenz und Auflösung
Von Candyass im Forum Microsoft WindowsAntworten: 4Letzter Beitrag: 15.09.03, 10:40





Zitieren
Login





