Wave Field Library (WFL) Polygon Source Library (PSL)

Size: px
Start display at page:

Download "Wave Field Library (WFL) Polygon Source Library (PSL)"

Transcription

1 Wave Field Library (WFL) Polygon Source Library (PSL)

2 2 WaveField Rel PolygonSource Rel Rel 2.13 WaveField ( WFL) PolygonSource ( PSL) / WFL/PSL WFL/PSL Acrobat Reader

3 3 I WaveField (WFL) WaveField MS Visual Studio.NET (Visual Studio 2003) MS Visual Studio 2005/ MS Visual Studio 2010/ MS Visual Studio Intel Parallel Studio XE (Intel C++ Compiler) WaveField WaveField FFT WaveField FFT sinc

4 FFT ( ) () void Start(int MsgLevel = 1) void Start(const char* fname) void Start(int MsgLevel, const char* fname) void PrintLog(const char* format,...) void PrintL(const char* format,...) void Printf(const char* format,...) double GetTickSec() FILE* GetLogFile(void) void SetNumThreads() void SetNumThreads(int n) void PushNumThreads(int n) int PopNumThreads(void) int GetNumThreads(void) void SetDynamicThreads(bool onoff) bool GetDynamicThreads(void) int GetNumProcs(void) / FFT / void* Malloc(size t size, const char* msg = NULL) void Free(void* p) void SetFftLib(FftLib fl) FftLib GetFftLib(void) / WF void CreateFileMpWf(const char* fname, unsigned short int size) int GetSizeMpWf(const char* fname)

5 5 void CreateFileSegWf(const char* fname, unsigned short int mx, unsigned short int my).. 59 int GetSizeSegWf(const char* fname, int& mx, int& my) void SetErrorHandling(ErrorHandling eh) ErrorHandling GetErrorHandling(void) void Error(ErrorCode n, const char* funcname, const char* msg) WFL ERROR1(n) WFL ERROR(n, msg) const char* GetErrorString(ErrorCode n) int GetMajorVersion(void) int GetMinorVersion(void) int GetPatchNumber(void) const char* GetVersionString(void) Platform GetPlatform(void) const char* GetPlatformString(void) DevelopEnv GetCreateEnv(void)) const char* GetCreateEnvString(void) DevelopEnv GetDevelopEnv(void) const char* GetDevelopEnvString(void) DevelopEnv GetTargetEnv(void) const char* GetTargetEnvString(void) CpuType GetCpuType(void) const char* GetCpuTypeString(void) const char* GetCreateEnvVersionString(void) const char* GetCreateTimeStamp(void) void SetPositionTolerance(double t) const double& GetPositionTolerance(void) const RMatrix& RMatrixX(double t) const RMatrix& RMatrixY(double t) const RMatrix& RMatrixZ(double t) const RMatrix& CRMatrixX(double t) const RMatrix& CRMatrixY(double t) const RMatrix& CRMatrixZ(double t) InterpolFunc GetInterpolFunc(Interpol interpol) void SetRandomSeed(int s) InterpolFunc Pi

6 6 PI Deg DEG FieldParam WaveField WaveField(void) WaveField(int nxy) WaveField(int nx, int ny) WaveField(int nx, int ny, double pxy) WaveField(int nx, int ny, double px, double py) WaveField(int nx, int ny, double px, double py, double wavelength) WaveField(const WaveField& wf); WaveField(void) void Dispose(void) WaveField& Init(Complex* d = NULL) WaveField& InitNxNy(void) Complex* GetDataPointer(void) WaveField& Clear(void) WaveField& CopyParam(const WaveField& source) WaveField& CopyData(const WaveField& source) static void SetDefault(long nxy) static void SetDefault(long nx, long ny) static void SetDefault(long nx, long ny, double pxy) static void SetDefault(long nx, long ny, double px, double py) static void SetDefault(long nx, long ny, double px, double py, double lmd) static void SetDefaultWavelength(double lmd) static double GetDefaultWavelength(void) static void SetDefaultNx(long nx) static void SetDefaultNy(long ny) static long GetDefaultNx(void) static long GetDefaultNy(void) static void SetDefaultPx(double px) static void SetDefaultPy(double py) static double GetDefaultPx(void) static double GetDefaultPy(void) bool IsRealSpace(void) const bool IsComplexAmplitude(void) const

7 7 bool IsFourierSpace(void) const bool IsSpectrum() const bool IsComplexForm(void) const bool IsPolarForm(void) const double GetWavelength(void) const LightWave& SetWavelength(double lambda) double GetWavenumber(void) const WaveField& SetWavenumber(double k) float& k(void) long long N(void) const long long GetN(void) const const long& GetNx(void) const const long& GetNy(void) const WaveField& SetNx(long n) WaveField& SetNy(long n) long& Nx(void) long& Ny(void) const double& GetPx(void) const const double& GetPy(void) const WaveField& SetPx(double pitch) WaveField& SetPy(double pitch) double& Px(void) double& Py(void) Complex& operator[](int i) Complex GetValue(int i, int j) const Complex GetPixel(int i, int j) const WaveField& SetValue(int i, int j, Complex val) WaveField& SetPixel(int i, int j, Complex val) Complex& Value(int i, int j) Complex& Pixel(int i, int j) double GetReal(int i, int j) const double GetImag(int i, int j) const WaveField& SetReal(int i, int j, double val) WaveField& SetImag(int i, int j, double val) float& Real(int i, int j) float& Imag(int i, int j) double GetAmplitude(int i, int j) void SetAmplitude(int i, int j, double val) Phase GetPhase(int i, int j) void SetPhase(int i, int j, double val)

8 8 double GetIntensity(int i, int j) void SetIntensity(int i, int j, double val) WaveField& SetConst(const Complex& c) WaveField& SetConstReal(double a) WaveField& SetConstImag(double b) WaveField& SetConstAmplitude(double A) WaveField& SetConstPhase(double p) WaveField& SetConstWin(const Complex& c) WaveField& SetConstWinReal(double a) WaveField& SetConstWinImag(double b) WaveField& SetConstWinAmplitude(double A) WaveField& SetConstWinPhase(double p) double X(int i) const double Y(int j) const int I(double x) const int J(double y) const int IJ(int i, int j) const double GetMaxX(void) const double GetMinX(void) const double GetMaxY(void) const double GetMinY(void) const double GetWidth(void) const double GetHeight(void) const double GetMaxX(void) const double GetMinX(void) const double GetMaxY(void) const double GetMinY(void) const WaveField& ShiftZeroFill(Axis axis, double dxy) WaveField& ShiftZeroFill(double dx, double dy) WaveField& ImageRotation(int n) WaveField& SwitchQuadrant(void) WaveField& Transpose(bool interval = true) WFL RECT& Window(void) WaveField& SetWindow(const WFL RECT& r) WaveField& SetWindow(int left, int right, int bottom = 0, int top = 0) WaveField& SetWindow(double left, double right, double bottom = 0.0, double top = 0.0) 82 WaveField& SetWindowMax(void) WaveField& SetWindowCommon(WaveField& signal)

9 9 WaveField& TransferWindow(WaveField& source) WaveField& operator=(const WaveField& wf) WaveField& operator*=(const WaveField& wf) WaveField& operator/=(const WaveField& wf) WaveField& operator+=(const WaveField& wf) WaveField& operator-=(const WaveField& wf) WaveField& operator*=(double val) WaveField& operator*=(const ComplexDouble& val) WaveField& operator/=(double val) WaveField& operator/=(const ComplexDouble& val) WaveField& operator+=(const ComplexDouble& val) WaveField& operator-=(const ComplexDouble& val) WaveField& SetNormalVector(Vector v) Vector GetNormalVector(void) const void SetCenter(Point p) void SetOrigin(Point p) Point GetCenter(void) const Point GetOrigin(void) const Vector GetUnitVectorX(void) const Vector GetUnitVectorY(void) const RMatrix GetCRMatrixLG(void) const RMatrix GetCRMatrixGL(void) const Point GetLocalPosition(Point p) const Point GetGlobalPosition(Point p) const Plane GetPlane(void) const Line GetOpticalAxis(void) const PointArray GetFrame(int n = 0) const WaveField& Add(const WaveField& wf) WaveField& Multiply(const WaveField& wf) WaveField& ResamplingAdd(const WaveField& wf, Interpol ip = CUBIC8) WaveField& ResamplingMultiply(const WaveField& wf, Interpol ip = CUBIC8) WaveField& ResamplingCopy(const WaveField& source, Interpol ip = CUBIC8, bool clear = true) void SaveAsGrayBmp(const char* fname, Mode mode, int depth = 8, double gamma = 2.2) const

10 10 void SaveAsBmp(const char* fname, Mode mode, Gradation cs = GRAY) const void SaveAsBmp(const char* fname, Mode mode, Gradation cs, int cw) const void SaveAsBmp(const char* fname, Mode mode, Gradation cs, int cw, double max, double min = 0.0) const void WinSaveAsGrayBmp(const char* fname, Mode mode, int depth = 8, double gamma = 2.2) const void WinSaveAsBmp(const char* fname, Mode mode, Gradation cs = GRAY) const void WinSaveAsBmp(const char* fname, Mode mode, Gradation cs, int cw) const void WinSaveAsBmp(const char* fname, Mode mode, Gradation cs, int cw, double max, double min = 0.0) const void SaveAsRgbBmp(const char* fname, const WaveField& green, const WaveField& blue, const Mode mode, double min = 0.0, double max = 0.0) const void WinSaveAsRgbBmp(const char* fname, const WaveField& green, const WaveField& blue, const Mode mode, double min = 0.0, double max = 0.0) const void SaveAsSegBmp(const char* fname, Mode mode, int mx, int my, Gradation cs = GRAY) const WaveField& LoadBmp(const char* fname, Mode mode, Complex backg = Comp(0, 0), double gamma = 1.0, ColorMode cm = GRAY SCALE) void SaveAsCsv(const char* fname, Axis axis = X AXIS, int ij = 0) const void SaveAsWf(const char* fname) const void WinSaveAsWf(const char* fname) const WaveField& LoadWf(const char* fname) void SaveAsMpWf(const char* fname, unsigned short int ix) const WaveField& LoadMpWf(const char* fname, unsigned short int ix, bool* exist = NULL).. 93 WaveField& LoadParamMpWf(const char* fname, unsigned short int ix, bool* exist = NULL) void SaveAsSegWf(const char* fname, unsigned short int ii, unsigned short int jj) const.. 94 void SaveParamSegWf(const char* fname) const WaveField& LoadSegWf(const char* fname, unsigned short int ii, unsigned short int jj, bool* exist = NULL) WaveField& LoadParamSegWf(const char* fname, unsigned short int ii, unsigned short int jj, bool* exist = NULL) void SaveAsLw(const char* fname, OptionHead* ohh = NULL) const void WinSaveAsLw(const char* fname, OptionHead* ohh = NULL) const WaveField& LoadLw(const char* fname, OptionHead* ohh = NULL) void SaveAsText(const char* fname, int j = 0) const

11 11 void SaveAsPTF(const char* fname) const void SaveAsDE(const char* fname) const WaveField& LoadDE(const char* fname) void SaveAsCA(const char* fname) const WaveField& LoadCA(const char* fname) void SaveAsHBI(...) const WaveField& LoadHBI(...) void SaveAsText(const char* fname, int j = 0) const WaveField& ConvToPolarForm(void) WaveField& ConvToComplexForm(void) WaveField& ConvToIntensity(void) WaveField& ConvToLogIntensity(void) WaveField& ConvToAbsolute(void) WaveField& ConvToConjugate(void) WaveField& Normalize(float max = 1.0) WaveField& NormalizeWin(float max = 1.0) ( ) WaveField& Fft(int s) WaveField& FakeFft() WaveField& ScaledFft(double ax, double ay) WaveField& AsmProp(double d) WaveField& AsmPropFs(double d) WaveField& ExactAsmProp(double d) WaveField& ShiftedAsmProp(const WaveField& source, int prec = 1) WaveField& ShiftedAsmPropAdd(const WaveField& source, int prec = 1) WaveField& ShiftedAsmPropEx(const WaveField& source) WaveField& ShiftedAsmPropAddEx(const WaveField& source) WaveField& FresnelProp(double d) WaveField& FourierProp(double f) WaveField& BackFourierProp(double f) WaveField& ShiftedFresnelProp(const WaveField& source) WaveField& ShiftedFresnelProp(const WaveField& source, const ShiftedFresnelPropDescriptor& sfpd) WaveField& ShiftedFresnelProp(const Vector& origin, double px, double py) WaveField& ShiftedFresnelProp(const Vector& origin, double px, double py, const ShiftedFresnelPropDescriptor& sfpd) WaveField& ShiftedFresnelPropAdd(const WaveField& source, const ShiftedFresnel- PropDescriptor& sfpd) WaveField& ShiftedFresnelPropEx(const WaveField& source) WaveField& ShiftedFresnelPropAddEx(const WaveField& source)

12 12 WaveField& Rotate(const WaveField& source, RMatrix& crmat, SFrequency* c = NULL, Interpol ip = CUBIC8, bool Jacobian = false) WaveField& RotateFs(const WaveField& source, RMatrix& crmat, SFrequency* c = NULL, Interpol ip = CUBIC8, bool Jacobian = false) WaveField& SetGaussian(double w, double n = 2.0, double a = 1.0) WaveField& SetEllipticGaussian(double rx, double ry, double n = 2.0, double a = 1.0) WaveField& SetSeparableGaussian(double wx, double wy, double nx = 2.0, double ny = 2.0, double a = 1.0) WaveField& SetRect(double wx, double wy, double a = 1.0); WaveField& AddSphericalWave(Point p, Phase phs, double a, WindowFunc w) WaveField& AddSphericalWave(Point p, Phase phs, double a) WaveField& AddSphericalWave(Point p) WaveField& AddSphericalWaveSqr(const SphericalWaveDescriptor& swd, double x, double y, double z, double a = 1.0, double InitPhase = 0, WindowFunc w = RECTANGLE) WaveField& SetRandomPhase(int m = 1) WaveField& ModRandomPhase(int m = 1) WaveField& SetQuadraticPhase(double f) WaveField& MultiplyQuadraticPhase(double f) WaveField& MultiplyPlaneWave(double CosA, double CosB, Phase phs = 0.0) WaveField& MultiplyPlaneWave(Vector dir, Phase phs = 0.0) WaveField& MultiplyPlaneWave(SFrequency f, Phase phs = 0.0) WaveField& SetPlaneWave(double CosA, double CosB, Phase phs = 0.0) WaveField& SetPlaneWave(Vector dir, Phase phs = 0.0) WaveField& SetPlaneWave(SFrequency f, Phase phs = 0.0) double GetSquareSum(void) const double GetSquareSumWhole(void) const double GetSquareAverage(void) const double GetAbsoluteSum(void) const double GetAmplitudeSum(void) const double GetAbsoluteAverage(void) const double GetAmplitudeAverage(void) const double GetAbsoluteMax(void) const double GetAmplitudeMax(void) const double GetAmplitudeMaxWhole(void) const double GetAmplitudeVariance(void) const ComplexDouble GetScaleFactor(const WaveField& signal) const double GetSnr(const WaveField& signal, const ComplexDouble& scalefactor) const double GetEnergyRatioInWindow(void) const WaveField& CreateRealHistogram(int level = 512) const

13 13 double GetOverlapFactor(const WaveField& sig) const WaveField& HardClipPhase(int level) WaveField& HardClipAmplitude(int level) WaveField& PartialClipPhase(int level, double epsilon) WaveField& PartialClipAmplitude(int level, double epsilon) Complex GetInterpolVal(double x, double y, Interpol ip = CUBIC8) const Complex GetInterpolVal(double x, double y, InterpolFunc intfunc = &Cubic8Interpol) const114 Complex Cubic8Interpol(double x, double y) const Complex Cubic6Interpol(double x, double y) const Complex Cubic4Interpol(double x, double y) const Complex LinearInterpol(double x, double y) const Complex AdjacentInterpol(double x, double y) const Complex BiLinear(double x, double y) const Complex BiCubic(double x, double y) const Complex NearestNeighbor(double x, double y) const WaveField& Replicate(int mxy = 1) WaveField& Replicate(int mx, int my) WaveField& EnlargeZeroFill(int mxy = 1) WaveField& EnlargeZeroFill(int mx, int my) WaveField& Embed(int mxy = 1) WaveField& Embed(int mx, int my) WaveField& Extract(int mxy = 1) WaveField& Extract(int mx, int my) WaveField& ReduceByAverage(int mxy = 1) WaveField& ReduceByAverage(int mx, int my) WaveField& ReduceByThinning(int mxy = 1) WaveField& ReduceByThinning(int mx, int my) WaveField& ExtractWindow(const WaveField& source, Complex backg = Complex(0.0, 0.0)) WaveField& Subdivide(int mxy = 1) WaveField& Subdivide(int mx, int my) WaveField& Pixelation(int mxy = 1) WaveField& Pixelation(int mx, int my) WaveField& DrawLine(int x1, int y1, int x2, int y2, const Complex& val = Comp(1.0, 0.0)) 119 WaveField& Paint(int x, int y, const Complex& val = Comp(1.0, 0.0)) WaveField& PaintTriangle(int x1, int y1, int x2, int y2, int x3, int y3, const Complex& val = Comp(1.0, 0.0)) WaveField& PaintTriangle(const PointArray& pa, const Complex& val = Comp(1.0, 0.0)). 120

14 Complex/ComplexDouble Complex(const float& a = 0.0, const float& b = 0.0) ComplexDouble(double a = 0.0, double b = 0.0) Complex(const ComplexDouble& c) ComplexDouble(const Complex& c) void SetReal(double a) double GetReal(void) const float& real(void) double& real(void) void SetImag(double b) double GetImag(void) const float& imag(void) double& imag(void) double GetAmplitude(void) void SetAmplitude(double val) Phase GetPhase(void) void SetPhase(double val) double GetIntensity(void) void SetIntensity(double val) void Comp(float a = 0.0, float b = 0.0) Complex Conjugate(void) const Complex& operator=(const Complex& c) Complex& operator=(const ComplexDouble& c) ComplexDouble& operator=(const Complex& c) ComplexDouble& operator=(const ComplexDouble& c) Complex& operator+=(const Complex& c) Complex& operator-=(const Complex& c) ComplexDouble& operator+=(const ComplexDouble& c) ComplexDouble& operator-=(const ComplexDouble& c) Complex& operator*=(const Complex& c) Complex& operator*=(double c) ComplexDouble& operator*=(const ComplexCouble& c) ComplexDouble& operator*=(double c) Complex& operator/=(const Complex& c) Complex& operator/=(double c) ComplexDouble& operator/=(const ComplexCouble& c) ComplexDouble& operator/=(double c)

15 15 Complex operator+(const Complex& rhs) const Complex operator-(const Complex& rhs) const ComplexDouble operator+(const ComplexCouble& rhs) const ComplexDouble operator-(const ComplexCouble& rhs) const Complex operator*(const Complex& rhs) const Complex operator*(double rhs) const ComplexDouble operator*(const ComplexCouble& rhs) const ComplexDouble operator*(double rhs) const Complex operator/(const Complex& rhs) const Complex operator/(double rhs) const ComplexDouble operator/(const ComplexCouble& rhs) const ComplexDouble operator/(double rhs) const Complex operator-(void) const ComplexDouble operator-(void) const bool operator==(const Complex& rhs) const bool operator==(const ComplexCouble& rhs) const Complex/ComplexDouble double abs(complexdouble c) Phase arg(complexdouble c) double norm(complexdouble c) ComplexDouble euler(double t) ComplexDouble exp(complexdouble c) ComplexDouble polar(double A, double t) Complex Comp(float r = 0.0, float i = 0.0) Phase Phase(void) Phase(double phase) Phase(float phase) Phase( Phase phase) operator double() const Phase operator+(phase p) Phase operator-(phase p) Phase Phase(double phase) Phase(float phase) operator double() const Vector/Point Vector(double x = 0, double y = 0, double z = 0) Point(double x = 0, double y = 0, double z = 0)

16 16 double GetX() const double GetY() const double GetZ() const void SetX(double val) void SetY(double val) void SetZ(double val) double& X() double& Y() double& Z() static Vector I(void) static Vector J(void) static Vector K(void) double GetLength(void) const Vector& SetLength(double len) double GetSqure(void) const Vector& Normalize(void) Vector GetNormalized(void) const double GetDistance(Point p) const double GetDistance(const Line& line)const double GetDistance(const Plane& plane)const bool IsInline(const Line& line) const bool IsInplane(const Plane& plane) const bool IsEmpty() Vector operator-(void) const Vector operator*(double rhs) const Vector operator/(double rhs) const Vector& operator*=(double rhs) Vector& operator/=(double rhs) Vector operator-(const Vector& rhs) const Vector operator+(const Vector& rhs) const Vector& operator-=(const Vector& rhs) Vector& operator+=(const Vector& rhs) double operator*(const Vector& vec) Vector operator&(const Vector& vec) const Vector& operator&=(const Vector& vec) Vector& operator*=(const RMatrix& mat) bool operator==(const Vector& rhs) const bool operator!=(const Vector& rhs) const PointArray

17 17 PointArray(int n = 0) PointArray(const Point& p) PointArray(const LineSegment& ls) int GetN(void) const const Point& GetPoint(int i) const Point& At(int i) const void SetPoint(int i, const Point& p) void Insert(const Point& p) void Insert(int i, const Point& p) void Remove(void) void Remove(int i) void Clear(void) PointArray& Rotate(const RMatrix& r) PointArray GetBoundingBox(void) const Vector GetCenter(void) const void SetCenter(const Vector& p) void Localize(void) double GetMaxX(void) const double GetMaxY(void) const double GetMaxZ(void) const double GetMinX(void) const double GetMinY(void) const double GetMinZ(void) const double GetWidth(void) const double GetHeight(void) const double GetDepth(void) const Plane GetPlane(void) const PointArray& ProjectionOn(const Plane& plane) PointArray& ProjectionOn(const Plane& plane, const Line& line) bool IsInplane(void) const void SaveAsCsv(const char* fname) const Point& operator[](int i) const PointArray& operator=(const PointArray& rhs) PointArray& operator-=(const Vector& rhs) PointArray& operator+=(const Vector& rhs) PointArray& operator*=(double m) PointArray& operator*=(const RMatrix& mat) bool operator==(const PointArray& rhs) bool operator!=(const PointArray& rhs) LineSegment

18 18 LineSegment() LineSegment(const Point& begin, const Point& end) const Point& GetBegin(void) const const Point& GetEnd(void) const double GetLength(void) const Vector GetVector(void)const Vector GetUnitVector(void) const PointArray& Rotate(const RMatrix& r) bool IsParallel(const Plane& plane) const bool Intersect(const Plane& plane) const bool IsEmpty(void) const bool operator==(const LineSegment& ls) bool operator!=(const LineSegment& ls) PointArray& operator=(const PointArray& rhs) PointArray& operator-=(const Vector& rhs) PointArray& operator+=(const Vector& rhs) PointArray& operator*=(double m) PointArray& operator*=(const RMatrix& mat) Line Line(void) Line(const Point& p, const Vector& n) Line(const LineSegment& ls) const Point& GetPoint(void) const const Vector GetUnitVector(void) const double GetDistance(const Point& p) const const Point& GetVerticalPoint(const Point& p) const Point GetIntersectionPoint(const Plane& plane) const bool IsParallel(Plane& plane) const bool Include(const Point& p) const PointArray& Rotate(const RMatrix& r) bool IsEmpty(void) const bool operator==(const Vector& rhs) const bool operator!=(const Vector& rhs) const PointArray& operator=(const PointArray& rhs) PointArray& operator-=(const Vector& rhs) PointArray& operator+=(const Vector& rhs) PointArray& operator*=(double m) PointArray& operator*=(const RMatrix& mat)

19 19 static Line X(void) static Line Y(void) static Line Z(void) Plane Plane(void) Plane(const Point& p1, const Point& p2, const Point& p3) Plane(const Point& p, const Vector& n) const Vector& GetNormalVector(void) const void SetNormalVector(const Vector& n) void Reverse(void) int GetSide(const Point& p) const double GetDistance(void) const double GetDistance(const Point& p) const double GetX(double y, double z) const double GetY(double x, double z) const double GetZ(double x, double y) const Point GetIntersectionPoint(const Line& line) const Line GetIntersectionLine(const Plane& plane) const Point GetVerticalPoint(const Point& p) const PointArray& Rotate(const RMatrix& r) bool IsParallel(const Line& line) const bool IsParallel(const Plane& plane) const Include(const Point& p) const Include(const Plane& plane) const bool IsEmpty(void) const bool operator==(const Plane& plane) const bool operator!=(const Plane& plane) const PointArray& operator=(const PointArray& rhs) PointArray& operator-=(const Vector& rhs) PointArray& operator+=(const Vector& rhs) PointArray& operator*=(double m) PointArray& operator*=(const RMatrix& mat) static Plane XY(void) static Plane YZ(void) static Plane ZX(void) SFrequency SFrequency() SFrequency(double lmd, double u, double v)

20 20 double GetWavelength(void) const void SetWavelength(double val) SFrequency& SetU(double val) SFrequency& SetV(double val) SFrequency& SetUV(double u, double v) double GetU(void) const double GetV(void) const double GetW(void) const double CalcW(void) const void Normalize(void) SFrequency& Rotate(const RMatrix& r) SFrequency operator-(const SFrequency& rhs) SFrequency operator+(const SFrequency& rhs) RMatrix RMatrix(void) RMatrix(const Vector& dest, const Vector& source) RMatrix GetInverse(void) Vector operator*(const Vector& p) const RMatrix operator*(const RMatrix& rhs) const SFrequency operator*(const SFrequency& sf) const static const RMatrix& RotationX(double t) static const RMatrix& RotationY(double t) static const RMatrix& RotationZ(double t) static const RMatrix& CRotationX(double t) static const RMatrix& CRotationY(double t) static const RMatrix& CRotationZ(double t) StopWatch StopWatch(void) void Reset(void) void Start(void) void Stop(void) double LapTime(void) double Read(void) FftLib ComplexForm

21 21 WindowFunc Mode ColorMode Interpol Axis ErrorCode ErrorHandling Gradation Platform CpuType DevelopEnv SphericalWaveDescriptor SphericalWaveDescriptor(double wavelength, double px, double py, Vector ref=vector(0, 0, 1.0)) bool IsSameAs(double wavelength, double px, double py, Vector ref=vector(0, 0, 1.0)) bool operator==(const SphericalWaveDescriptor& swd) ShiftedFresnelPropDescriptor ShiftedFresnelPropDescriptor(double distance, double dpx, double dpy, double spx, double spy, double wavelength, int nx, int ny) ShiftedFresnelPropDescriptor(double distance, double destpx, double destpy, const Wave- Field& source) bool IsCompatibleWith(double distance, double dpx, double dpy, double spx, double spy, double wavelength, int nx, int ny) const bool IsCompatibleWith(double distance, double dpx, double dpy, const WaveField& source) const bool operator==(const ShiftedFresnelPropDescriptor& sfpd) const II PolygonSource (PSL) PolygonSource PolygonSource

22 UV ( ) psl Vector ColorMatchingCIE1931XYZ(double lambda) Color ColorSRGB(Vector XYZ) Vector ColorXYY(Vector XYZ) void MultiplyDiffuser(WaveField& fb, const WaveField& diffuser) double CorrectedPolygonAmplitude(const WaveField& pfb, const WaveField& tfb, double brt, double gamma = 0) void PaintPolygonShape(WaveField& fb, const Polygon& polygon, Complex amp) void PaintObjectSilhouette(WaveField& fb, const IndexedFaceSet model) int GetTextureNamesMqo(const char *fname, std::vector char* & texnames) int GetTextureNamesMqo(const wchar t *fname, std::vector char* & texnames) int GetNumOfTextureMqo(const char *fname) int GetNumOfTextureMqo(const wchar t *fname) AofCallback Statics IndexedFaceSet IndexedFaceSet() IndexedFaceSet(const PointArray& pa) int GetNumberOfPolygon(void) const

23 23 int GetNumberOfVertex(int n) const int GetNumberOfPoint(int n) const int GetVertexIndex(int n, int m) const int GetPointIndex(int n, int m) const void Insert(const Point& p) void Clear(void) const Point& GetPoint(int n, int m) const const Point& GetVertex(int n, int m) const Point& PointAt(int n, int m) Point& VertexAt(int n, int m) void InsertPolygon(int p1, int p2, int p3, int p4 = -1) void InsertPolygon(Polygon polygon) void RemovePolygon(int n) void InsertPoints(const PointArray& pa) Polygon GetPolygon(int n) const void SetColor(int n, const Color& cl) const Color& GetColor(int n) const void SetTexMap(int n, int m, const TexMap& uv) TexMap GetTexMap(int n, int m) const void SetTexNum(int n, int num) int GetTexNum(int n) const void SetNormalVector(int n, const Vector& vec) const Vector& GetNormalVector(int n) const void AutoNormalVector(void) void SetWidth(double v) void SetHeight(double v) void SetDepth(double v) int EliminateDefectPolygon(void) int EliminateDuplicatePoint(void) void BreakQuad(int n, int method = 0) void BreakQuadAll(int method = 0) void Add(const IndexedFaceSet& ifs) void Split(IndexedFaceSet& front, IndexedFaceSet& back, double z) void AutoSplit(IndexedFaceSet& front, IndexedFaceSet& back) void DivideByDepth(IndexedFaceSet& front, IndexedFaceSet& back, double z) const void SortByDepth(void)) const double GetArea(unsigned int n) const Statistics GetDepthStatistics(void) const Statistics GetAreaStatistics(void) const void TessellationByDepth(double depth) void TessellationByArea(double area) void GetLineTable(std::vector LineSegment & ls)

24 24 int AddWireFrameField(WaveField& fb, double density, double amp = 1.0, int from = 0, int to = -1) int LoadWrl(const char* fname) int LoadWrl(const wchar t* fname) int LoadDxf(const char* fname) int LoadDxf(const wchar t* fname) void SaveAsDxf(const char* fname, double mul = ) void LoadPov(const char* fname) void LoadPov(const wchar t* fname) void LoadPov(const char* fname, int n) void LoadPov(const wchar t* fname, int n) void LoadMqo(const char *fname) void LoadMqo(const wchar t *wfname) void LoadMqoOld(IndexedFaceSet& uvmap, const char *fname) void LoadMqoOld(IndexedFaceSet& uvmap, const wchar t *wfname) static IndexedFaceSet SquareObject(double Aspect, int nx, int ny) SurfaceBuilder SurfaceBuilder(double wavelength, double px, double py) SurfaceBuilder(const WaveField& wf) SurfaceBuilder(void) void SetDiffractionRate(double df) double GetDiffractionRate(void) void SetCullingRate(double val) double GetCullingRate(void) void SetPfbExtension(bool onoff) void SetTfbExtension(bool onoff) void SetDefaultInterpol(Interpol interpol) Interpol GetDefaultInterpol(void) void SetShader(TfbPaint& sh) TfbPaint& GetShader(void) void SetTexture(TfbPaint& sh) TfbPaint& GetTexture(void) void SetCurrentPolygon(Polygon& p) const Polygon& GetPolygon(void) const void AddPolygonField(WaveField& framebuff) void AddPolygonField(WaveField& framebuff, Interpol ip)

25 25 void AddObjectField(WaveField& framebuff, IndexedFaceSet& model) void AddObjectField(WaveField& framebuff, IndexedFaceSet& model, Interpol ip) void AddObjectField(WaveField& framebuff, IndexedFaceSet& model, int t) void AddObjectField(WaveField& framebuff, IndexedFaceSet& model, int t, Interpol ip). 200 void AddObjectFieldMt(WaveField& framebuff, IndexedFaceSet& model, Interpol ip = wfl::bicubic)) void AddObjectFieldMt(WaveField& framebuff, IndexedFaceSet& model, int threads, Interpol ip = wfl::bicubic) void AddObjectFieldSm(WaveField& frame, const IndexedFaceSet& model, int ndiv = 10, bool exact = false, bool backg = true, double pos = 0.5, int t = 0) void SetCallback(AofCallback prog) void AddPolygonFieldSb(WaveField& frame, const Polygon& polygon) void AddPolygonFieldSb(WaveField& frame) void AddObjectFieldSb(WaveField& frame, IndexedFaceSet& model, int ndiv = 10, bool exact = false, bool backg = true) void AddObjectFieldSbUnity(WaveField& frame, IndexedFaceSet& model) void SetBandLimitMethod(int method) GetBandLimitMethod(void) const BoundingBox BandForPoint(Point p) const BoundingBox BandForPolygon(const PointArray& pa) const BoundingBox BandForPolygon1(const PointArray& pa) const BoundingBox BandForPolygon3(const PointArray& pa) const void BandLimiting(WaveField& wf, BoundingBox bb) void BandToWindow(WaveField& wf, BoundingBox bb) const void PolygonBandLimiting(WaveField& wf, const PointArray& polygon) BoundingBox GetDiffractionRect(const PointArray& pa, double z) int GetNumOfVisible(const IndexedFaceSet& model) void BackFaceCulling(IndexedFaceSet& model) bool IsVisible(void) void SetupTfb(WaveField& tfb) void SetupPfb(WaveField& pfb) const void PaintPolygonShape(WaveField& tfb, double amp) void RotateFs(WaveField& pfb, const WaveField& tfb, SideOption side) const void SetFrameZ(double fz) double GetFrameZ(void) const Point GetRotationCenter(void) void SetBalanceRotation(bool onoff)

26 26 void SetRemappingShift(SFrequency sh) SFrequency GetRemappingShift(void) const PointArray& GetCulledReferencePoint(void) const double GetTfbDensityRatio(void) TfbPaint : TfbPaint TfbPaint(double gm) virtual void PaintTfb(WaveField& tfb, const psl::polygon& polyl, const psl::polygon& polyg, const WaveField& pfb, SurfaceBuilder* sb = NULL) = double GetGamma(void) void SetGamma(double gm) / TfbFlatShading(const WaveField& diffuser, double gam) TfbFlatShading(const WaveField& diffuser, double gam, Vector dir, double env) TfbFlatShading(double gam, Vector dir, double env) Vector GetDirection(void) double GetEnvironment(void) TfbGouraudShading(const WaveField& diff, double gam, Vector dir, double env) TfbGouraudShading(double gam, Vector dir, double env) TfbPhongShading(const WaveField& diff, double gam, Vector dir, double env) TfbPhongShading(double gam, Vector dir, double env) TfbSpecularFlatShading(const WaveField& diffd, const WaveField& diffs, double gam, Vector dir, double env, double weightd, double weights) TfbSpecularSmoothShading(const WaveField& diffd, const WaveField& diffs, double gam, Vector dir, double env, double weightd, double weights, int SegNxy = 32) TfbOlthoProjectMapping(const WaveField& texture) TfbUvMapping(Texture& tex) TfbUvMapping(vector Texture* & texes) TfbUvMapping(const std::vector char* & texnames double gamma = 1.0, wfl::colormode cm = wfl::gray SCALE) TfbUvMapping(const std::vector char* & texnames, const char* dir, double gamma = 1.0, wfl::colormode cm = wfl::gray SCALE) std::vector psl::texture* GetTexes(void) TfbUVMapping(const WaveField& texture, const IndexedFaceSet& object, const Indexed- FaceSet& uvmap, const int texnx, const int texny) psl::polygon Polygon() explicit Polygon(const PointArray& points) explicit Polygon(const IndexedFaceSet& model, int n) void Insert(const Point& p) void Insert(int i, const Point& p)

27 27 Vector GetNormalVector(void) const Point GetAveragePoint(void) const void SetBrightness(double b) double GetBrightness(void) const void SetColor(const Color& c) const Color& GetColor(void) const Color& Color(void) void SetTexMap(int n, const TexMap uv) TexMap GetTexMap(int n) const void SetTexNum(int num) int GetTexNum(void) const double GetArea(void) const void ReverseVertexOrder(void) std::ostream& operator (std::ostream& os, const Polygon& polygon) Color Color(void) Color(double red, double green, double blue, double alpha = 0.0) double GetBrightness(void) const void SetBrightness(double brt) unsigned char GetRed8bit(void) unsigned char GetGreen8bit(void) unsigned char GetBlue8bit(void) TexMap TexMap() TexMap(double u, double v) double U double V Texture Texture() Texture& LoadBmp(const char* fname, Mode mode, Complex backg = Complex(0, 0), double gamma = 1.0, ColorMode cm = GRAY SCALE) Texture& LoadBmp(const char* fname, double gamma = 1.0, ColorMode cm = GRAY SCALE) int GetTexNx(void) const int GetTexNy(void) const void SetTexNx(int Nx) void SetTexNy(int Ny)

28 28 double GetWidth(void) const double GetHeight(void) const void SetWidth(double s) void SetHeight(double s) double GetAspectRatio(void) const void SetAspectRatio(double a) BoundingBox BoundingBox(void) BoundingBox(const PointArray& pa) BoundingBox GetCommonRegion2D(const BoundingBox& bb) bool IsEmpty2D(void) bool IsEmpty2D(double criterion) bool IsEmpty2D(double cx, double cy) bool IsOverlap2D(const BoundingBox& bb) bool IsOverlap2D(const BoundingBox& bb, double criterion) bool IsOverlap2D(const BoundingBox& bb, double cx, double cy) PointArray GetFrame2D(int n) ImagingViewer ImagingViewer() void SetImagingDistance(double v) double GetImagingDistance(void) const void SetPupilDiameter(double v) double GetPupilDiameter(void) const void View(const WaveField& wf, Point p) void View(SegWaveField& wf, Point p) void SpectralView(const WaveField& wf, Point p, ColorImage& image) void MultiSpectralView(const vector WaveField* & wf, Point p, ColorImage& image) void MultiSpectralView(const char* fname, Point p, ColorImage& image) void MultiSpectralView(const vector string list, Point p, ColorImage& image); void ViewWf(const char* fname, Point p) void ViewHologramSw(SegWaveField& holo, Point p, Point rp) void ViewHologramSw(SegWaveField& holo, Point p, Point rp, double lambda) void ViewHologramPw(SegWaveField& holo, Point p, Vector kv) void SaveAsReducedBmp(const char* fname, int nx = 1024, int ny = 1024) const void SaveAsReducedWf(const char* fname, int nx = 1024, int ny = 1024) const void Imaging(Point p) void SetHumanEyeParam(void) SegWaveField (Segmented wave-field)

29 29 SegWaveField(const char* fn = NULL) SegWaveField(int mx, int my, const char* fn = NULL) SegWaveField(int mx, int my, const WaveField& temp, const char* fn = NULL) SegWaveField(int mx, int my, int nx, int ny, const char* fn = NULL) SegWaveField(double width, double height, const char* fn = NULL) SegWaveField(double width, double height, const WaveField& temp, const char* fn = NULL) SegWaveField(const WaveField& wf, int mx, int my, const char* fn = NULL) SegWaveField(const SegWaveField& swf, int cmx, int cmy, const char* fn = NULL) SegWaveField(SegWaveField& swf) const char* GetFileName(void) const void Dispose(void) void Dispose(const char* fn) void Init(void) static void SetDefault(int mx, int my) int GetMx(void) const int GetMy(void) const int GetM(void) const void SetMx(int value) void SetMy(int value) double GetTotalWidth(void) const double GetTotalHeight(void) const Point GetCenter(void) void SetCenter(Point c) double XX(int i) double YY(int j) int II(double x) int JJ(double y) void SyncParam(void) void CopyParam(const SegWaveField& swf) void CombineInto(WaveField& wf)) WaveField& Segment(int i, int j) WaveField& Segment(int m) void SaveSeg(void) void DisposeSeg(void) bool Exist(int i, int j) const bool Exist(int m) const int GetCx(void) const int GetCy(void) const / void SaveAsSegWf(const char* fname)

30 30 void LoadSegWf(const char* fname) void SaveAsSegBmp(const char* fname, wfl::mode mode, wfl::gradation cs = wfl::gray) const void SaveAsSegBmp(const char* fname, wfl::mode mode, BoundingBox bb, wfl::gradation cs = wfl::gray) const void SaveAsSegGrayBmp(const char* fname, Mode mode, int depth = 8, double gamma = 2.2) const void SaveAsSegGrayBmp(const char* fname, Mode mode, BoundingBox bb, int depth = 8, double gamma = 2.2) const void SaveAsCombinedBmp(const char* fname, wfl::mode mode, wfl::gradation cs = wfl::gray) void SaveAsCombinedGrayBmp(const char* fname, Mode mode, int depth = 8, double gamma = 2.2) void SaveAsCombinedGrayBmp(const char* fname, Mode mode, BoundingBox bb, int depth = 8, double gamma = void LoadSegBmp(const char* fname, wfl::mode mode) void LoadSegBmpAuto(const char* fname, wfl::mode mode) void LoadBmp(const char* fname, Mode mode, Complex backg = Complex(0, 0), double gamma = 1.0, ColorMode cm = GRAY SCALE) void LoadBmpAuto(const char* fname, Mode mode, Complex backg = Complex(0, 0), double gamma = 1.0, ColorMode cm = GRAY SCALE) void SaveAsCombinedWf(const char* fname) SegWaveField& ShiftedAsmProp(SegWaveField& source) SegWaveField& ShiftedAsmProp(double dz) SegWaveField& ShiftedAsmPropWhole(SegWaveField& source) SegWaveField& ShiftedFresnelProp(SegWaveField& source) SegWaveField& ShiftedFresnelProp(double dz) SegWaveField& ShiftedFresnelPropWhole(SegWaveField& source) void Add(const WaveField& wf) void Add(SegWaveField& swf) void AddTo(WaveField& wf) void Multiply(const WaveField& wf) void ResamplingCopy(const WaveField& wf, Interpol ip = wfl::cubic8) BoundingBox GetBoundingBox(int ii, int jj) const BoundingBox GetBoundingBox(int m) const ColorImage ColorImage(int Nx, int Ny) ColorImage(const WaveField& wf)

31 31 void Clear(void) int GetNx() const int GetNy() const Vector GetColorXYZ(int i, int j) const Vector GetColorXYY(int i, int j) const Color GetColorSRGB(int i, int j) const double GetBrightness(int i, int j) const void AddSpectralImage(const WaveField& wf) void operator+=(const WaveField& wf) void SetWindow(WFL RECT win) void SetWindow(int left, int right, int bottom, int top) void NormalizeY(double y = 1.0) void NormalizeWinY(double y = 1.0) void NormalizeXYZ(double s = 1.0) void NormalizeWinXYZ(double s = 1.0) void NormalizeVec(double s = 1.0) void NormalizeWinVec(double s = 1.0) double GetMaxY(void) double GetMaxXYZ(void) double GetMaxVecLength(void) void SaveAsBmpSRGB(const char* fname)

32

33 I WaveField (WFL)

34

35 WaveField WaveField PolygonSource WFL MS Visual Studio.NET (Visual Studio 2003) WFL MS Visual Studio 2005/2008 WFL Visual Studio IntelliSense 64 CPU (64 Visual Studio ) MS Visual Studio 2010/2012 WFL 64 CPU IntelliSense MS Visual Studio 2013 IntelliSense Intel Parallel Studio XE (Intel C++ Compiler) WFL WFL Visual Studio 2013 Intel Parallel Studio XE 2015

36 WFL3.0 Beta3 WFL < >=c:\wavefieldtools < >\include\ < >\include\wfl\ *.h WFL < >\lib\win32\ 32 < >\lib\ 64 wfl3.lib WFL PATH (.exe ) < >\bin\win32\ 32 < >\bin\ 64 wfl3.dll < >\SampleCode\ :*.cpp

37 WaveField WFL Example # include <wfl.h> using namespace wfl ; void main ( void ) { Start (); /* */ } wfl.h WFL wfl.h WFL WaveFieldLib wfl wfl using namespace wfl::start(); WFL Start() wflx.lib wfl.h wflx.lib PATH (*.EXE) wflx.dll

38 38 2 N N 2 N N N 2 N E N 2 N N F E N A E N N N 2 N N WaveField 1 WaveField WaveField 1 ( ) Example (: ExSimple1D-a.cpp) 1 # include " wfl.h" 2 using namespace wfl ; 3 4 void main () 5 { 6 Start (); 7 WaveField a (256, 1, 0.01), b (1024, 1, 0.02); 8 9 double f = 0.1; // 0.1 [1/ m] 10 double omega = 2 * Pi * f; // int i; 13 a. Clear (); // a 14 for (i = 0; i < a. GetNx (); i ++) // i < { 16 double x = a.x(i); // i x 17 a. SetReal (i, 0, cos ( omega *x )); // i c o s (x) 18 } b. Clear (); 21 for (i = 0; i < b. GetNx (); i ++) // i < { 23 double x = b.x(i); // i x 24 b. SetImag (i, 0, sin ( omega *x )); // i s i n (x) 25 } a. SaveAsCsv (" c o s. csv "); // C S V 28 b. SaveAsCsv (" s i n. csv "); 29 } 7 WaveField 1 N y = 1 a N x = 256 P x = 0.01[m] b N x = 1024

39 2.2 WaveField 1 39 P x = 0.02[m] WaveField Clear() 2.1 [m] SI WaveField 2 n (n: ) 2 n 2 n i 0 i < N x for GetNx() Nx() i = N x /2 ( ) N x P x /2 x +(N x /2 1)P x N x P x /2 x < +N x P x /2 (x = +N x P x /2 ) X() ( ) I() (3.1) (3.2) WaveField Complex () SetReal() (17 ) SetImag() (24 ) a b 10 ( )Pi WFL SaveAsCsv() CSV Example (: ExSimple1D-b.cpp) 1 # include " wfl.h" 2 using namespace wfl ; 3 4 void main () 5 { 6 Start (); 7 WaveField :: SetDefault (512, 1); // 8 WaveField :: SetDefaultPx (0.01); // 9 10 WaveField a, b; // double f = 0.1; // 0.1 [1/ m] 13 double omega = 2 * Pi * f; // 14 int i; 15 b. Clear (); // 16 for (i = 0; i < a. GetNx (); i ++) // i < { 18 Complex c = (0, omega *a.x(i )); 19 a. SetValue (i, 0, exp (c )); // i e x p ( i 2 f x )

40 b. SetReal (i, 0, b.x(i)*b.x(i )); // i x 2 21 } 22 a *= b; // a = a * b 23 a *= 3.0; // a = a * 3 24 a. SaveAsCsv (" function. csv "); // C S V 25 } 7 8 SetDefault() SetDefaultPy() 10 a b P x = 0.01[m] a exp() exp(i2πfx) (18, 19 ) b x 2 (20 ) a 3x 2 exp(i2πfx) 19 exp() euler() euler() a.setvalue(i, 0, euler(omega*a.x(i))); FFT 1 Example (: Ex1DFft-a.cpp) 1 # include <wfl.h> 2 using namespace wfl ; 3 4 void main ( void ) 5 { 6 Start (); 7 WaveField :: SetDefault (1024, 1, 0.01); 8 WaveField a, b; 9 int i; // a 12 a. Clear (); 13 for (i = a.i ( -0.5); i < a.i (+0.5); i++) 14 a. SetReal (i, 0, 1.0); 15 a. SaveAsCsv (" Rect. csv "); 16 a. Fft ( -1); // 17 a. SaveAsCsv ("FFT - Rect. csv "); // ( ) b 20 b. Clear (); 21 for (i = b.i ( -1.0); i < b.i (+1.0); i++) 22 b. SetReal (i, 0, fabs (b.x(i ))); 23 b. SaveAsCsv (" lambda. csv "); 24 b. Fft ( -1); // 25 b. SaveAsCsv ("FFT - lambda. csv "); 26 } 1/2 x +1/2 Λ 1 x I() i ( ) Fft() Fft() 1 +1 (3.3)

41 2.3 WaveField 2 41 SetRect() a.setrect(1.0, 1.0); ( ) a *= a.getpx(); b *= b.getpx(); 2.3 WaveField 2 WaveField BMP Example (: ExSphericalWave-a.cpp) 1 # include <wfl.h> 2 using namespace wfl ; 3 4 void main ( void ) 5 { 6 Start (); 7 WaveField f (512, 512, 10e -6); // 512 x int i, j; 9 double z = 100e -3; // 100 m m // f 12 for (j = 0; j < f. GetNy (); j++) 13 for (i = 0; i < f. GetNx (); i++) 14 { 15 double x = f.x(i), y = f.y(j); 16 double r = sqrt (x*x + y*y + z*z); 17 f. SetValue (i, j, polar (1/r, f. GetWavenumber ()* r )); 18 } f. Normalize (); // 21 f. SaveAsGrayBmp (" SphericalWave - amp. bmp ", AMPLITUDE ); 22 f. SaveAsGrayBmp (" SphericalWave - phs. bmp ", PHASE ); 23 } (x, y, z) (x, y, 0) f(x, y) = r 1 exp[ikr] r = x 2 + y 2 + z 2 (2.1) polar() f(x, y) f f(x, y) 2 BMP SaveAsGrayBmp() WaveField BMP Mode 2.2

42 42 2 SaveAsGrayBmp() SaveAsBmp() Gradation COLOR SaveAsBmp() SaveAsGrayBmp() A A = 0 A = 1 0 A 1.0 Normalize() z Normalize() z z WFL AddSphericalWaveSqr() 2.2 (SphericalWave-phs.bmp) Example (: Ex2DFftRect.cpp) 1 # include <wfl.h> 2 using namespace wfl ; 3 4 void main ( void ) 5 { 6 Start (); 7 WaveField a (512, 512, 0.1); // 512 x a. SetRect (1.0, 1.0); // 1 a 9 a. Fft ( -1); // 10 a. Normalize (); 11 a. SaveAsBmp (" RectFFT - amp. bmp ", AMPLITUDE, COLOR ); 12 } 11 SaveAsBmp() Gradation COLOR SaveAsBmp()

43 2.3 WaveField a.saveasbmp("rectfft-amp.bmp", AMPLITUDE, COLOR, 0); 2 FFT FFT WFL FFT GPGPU FFT () Fft() FFT wfl::setfftlib() 2.3 (RectFFT-amp.bmp) FFT sinc FFT sinc Example (: ExSincInterpol.cpp) 1 # include <wfl.h> 2 using namespace wfl ; 3 4 void main ( void ) 5 { 6 Start (); 7 WaveField a; 8 a. LoadBmp (" shion -128 gs.bmp ", INTENSITY, 0, 2.2); // a. ModRandomPhase (); // 10 a. SaveAsGrayBmp (" input - int. bmp ", INTENSITY ); // 11 a. SaveAsGrayBmp (" input - phs. bmp ", PHASE ); // 12 a. Fft ( -1); // 13 a. Embed (); // 14 a. Normalize (); 15 a. SaveAsGrayBmp (" EmbededSpectrum. bmp ", INTENSITY ); // 16 a. Fft (1); // 17 a. Normalize (); 18 a. SaveAsGrayBmp (" OutputImage. bmp ", INTENSITY ); // 19 } 8 LoadBmp() WaveField a LoadBmp() ModRandomPhase() 2.4 sinc Embed()

44 44 2 input-int.bmp 2.4 input-phs.bmp phase dislocation () phase dislocation( ) unwrapping ( ) 2 EmbededSpectrum.bmp OutputImage.bmp 2.5 sinc mm 20mm 2 Example (1) (: ExCircAperture-a.cpp) 1 # include <wfl.h> 2 using namespace wfl ; 3 4 void main ()

45 { 6 Start (); 7 WaveField a (256, 256, 2e -6); 8 9 // ===== a 10 int i, j; 11 for (i = 0; i < a. Nx (); i++) 12 { 13 for (j = 0; j < a. Ny (); j++) 14 { 15 double x = a.x(i); 16 double y = a.y(j); 17 double r = sqrt (x*x + y*y); 18 if (r < 0.1e -3) // 0.1 m m 19 a. SetValue (i, j, Complex (1.0, 0)); // else 21 a. SetValue (i, j, Complex (0, 0)); // } 24 } 25 a. SaveAsGrayBmp (" Aperture. bmp ", AMPLITUDE ); // // ===== 28 a. AsmProp (1e -3); //1 m m 29 a. Normalize (); 30 a. SaveAsGrayBmp (" Diffraction. bmp ", INTENSITY ); //( ) 31 } a a 0.1mm (a) (a) Aperture.bmp (b) Diffraction.bmp WaveField AsmProp() a AsmProp() WaveField () 2.6(b) [1] [2] 1mm 2.6(b) 0 1 2

46 46 2 (a) Aperture.bmp (b) Diffraction.bmp 2.7 Example (2) (: ExCircAperture-b.cpp) 1 # include <wfl.h> 2 using namespace wfl ; 3 4 void main () 5 { 6 Start (); 7 WaveField a (256, 256, 2e -6); 8 9 // ===== a 10 a. SetGaussian (0.1e -3, 50); // 0.1 m m 11 a. SaveAsGrayBmp (" Aperture. bmp ", INTENSITY ); // // ===== 14 a. AsmProp (1e -3); //1 m m 15 a. Normalize (); 16 a. SaveAsGrayBmp (" Diffraction. bmp ", INTENSITY ); //( ) 17 } 10 WaveField SetGaussian() 2 SetGaussian() 2 2 ( 50 ) * (b) FFT WaveField AsmProp() AsmProp() 2.6(a) 2.8 Example (: ExCircAperture-c.cpp) 1 # include <wfl.h> 2 using namespace wfl ; 3 4 void main () 5 { 6 Start (); 7 WaveField a (256, 256, 2e -6); 8 9 a. SetGaussian (0.1e -3, 50); 10 a. SaveAsGrayBmp (" Aperture. bmp ", INTENSITY ); // 11 *1

47 // ===== 13 for ( int i = 1; i <= 3; i ++) 14 { 15 WaveField b = a; // b a 16 double d = 10e -3 * i; // d 17 b. AsmProp (d); // b d 18 char fname [80]; // 19 sprintf ( fname, " Diffraction -%d. bmp ", ( int )(d/1e -3)); 20 b. Normalize (); 21 b. SaveAsGrayBmp ( fname, INTENSITY ); //( ) 22 } 23 } (a) Diffraction-10.bmp (b) Diffraction-20.bmp (c) Diffraction-30.bmp 2.8 AsmProp() (a)10mm (b)20mm (c)30mm 15 WaveField b a AsmProp() 2.8(c) 4 ( 2 ) WaveField Embed() Extract() AsmProp() Example ( ) (: ExCircAperture-d.cpp) 1 // ===== ( ) 2 for ( int i = 1; i <= 3; i ++) 3 { 4 WaveField b = a; 5 double d = 10e -3 * i; 6 b. Embed (1); //4 7 b. AsmProp (d); // 8 b. Extract (1); //4 1 9 char fname [80]; 10 sprintf ( fname, " Diffraction -%d. bmp ", ( int )(d/1e -3)); 11 b. Normalize (); 12 b. SaveAsGrayBmp ( fname, INTENSITY ); 13 } ExactAsmProp()

48 48 2 (a) Diffraction-10.bmp (b) Diffraction-20.bmp (c) Diffraction-30.bmp (a)10mm (b)20mm (c)30mm FFT AsmPropFs() FFT 1 FFT 2 *2 FFT 1 WaveField WaveField FresnelProp() Example 1 # include <wfl.h> 2 using namespace wfl ; 3 1 FFT (: ExSftFresnel.cpp) 4 void main () 5 { 6 Start (); 7 WaveField a (256, 256, 10e -6); 8 a. SetGaussian (0.5e -3, 50); 9 10 // ===== 11 for ( int i = 1; i <= 3; i ++) 12 { 13 WaveField b = a; // b a 14 double d = 20e -3 * i; // d 15 b. FresnelProp (d); // b d 16 b. Normalize (); 17 char fname [80]; // 18 sprintf ( fname, " Diffraction -%d. bmp ", ( int )(d/1e -3)); 19 b. SaveAsGrayBmp ( fname, INTENSITY ); //( ) 20 printf (" :%2.0 lf[mm] : % 4. 2 l f %4.2 lf [mm ^2]\ n", 21 d/1e -3, b. GetWidth ()/1e -3, b. GetHeight ()/1e -3); 22 } 23 } *2 CPU

49 FresnelProp() 21 WaveField GetWidth() GetHeight() () FFT 1 FFT 1 FFT Example 1 *** WFL <Intel C++/ X64 / SSE1 > Rel [ MATSU2016 ] No. of Cores : 8 2 : 2 0 [ mm] : [mm ^2] 3 : 4 0 [ mm] : [mm ^2] 4 : 6 0 [ mm] : [mm ^2] 5... = > F >, E B B H =? J E " > F >, E B B H =? J E $ > F FFT (a)20mm (b)40mm (c)60mm µm 532nm Example (: ExSlitBeam-a.cpp) 1 # include <wfl.h> 2 using namespace wfl ; 3 4 void main () 5 { 6 Start (); 7 WaveField :: SetDefault (512, 512, 10e -6, 10e -6, 532e -9); 8 WaveField a, b; 9 a. SetGaussian (1e -3); // 1/ e 2 m m 10 b. SetRect (50e -6, 5e -3); // m m 11 b *= a; 12 b. ExactAsmProp (50e -3); // 5 0 m m 13 b. Normalize (); 14 b. SaveAsGrayBmp (" intensity. bmp ", INTENSITY ); //( ) 15 b. SaveAsGrayBmp (" phase. bmp ", PHASE ); // 16 } a b

50 50 2 1/e 2mm 9 WaveField SetGaussian() 2 WaveField SetRect() 10 (11 ) ExactAsmProp() 2.11 (a) 強度像 (b) 位相像 2.11 Example (: ExImageFormationByLens.cpp) 1 # include <wfl.h> 2 using namespace wfl ; 3 4 void main () 5 { 6 Start (); 7 WaveField :: SetDefault (128, 128, 2e -6); 8 double R = 1e -3; // 9 10 // ===== a 11 WaveField a; 12 a. LoadBmp (" Shion -128 gs. bmp ", INTENSITY, 0, 2.2); 13 a. Embed (3); // 8 x // ===== b 16 WaveField b; 17 b. Embed (3); // a 18 b. SetGaussian (R, 100); // R 19 b. SetQuadraticPhase (10e -3); // 1 0 mm 20 b. SaveAsWf (" lens.wf"); // w f // ===== a 23 a. ExactAsmProp (20e -3); // 2 0 mm // ===== a b 26 b *= a; // ===== b 29 b. ExactAsmProp (20e -3); // 2 0 mm 30 b. Extract (3); // 1/(8*8) 31 b. Normalize (); 32 b. SaveAsGrayBmp (" image. bmp ", INTENSITY ); // 33 } a b a 2.12(a) LoadBmp() 2.2 2µm

51 2.5 ( ) 51 ( µm 2!) 13 Embed() b SetGaussian() 100 SetQuadraticPhase() 10mm a b b ExactAsmProp() b 20mm 2.12(b) R=1mm R=0.5mm R=0.2mm (a) 原画像 (b) 再 像 2.12 (a) (b) 20 WaveField SaveAsWf() WF WF WaveField WF WaveField LoadWf() WaveField WaveFront WF 2.5 ( ) () 0.5 mm 45 ()

52 52 2 Example (: ExRotationalTransform-a.cpp) 1 # include <wfl.h> 2 using namespace wfl ; 3 4 void main () 5 { 6 Start (); 7 WaveField u0 (2048, 2048, 0.5e -6); // 2 K 2 K 0.5 m 8 u0. SetGaussian (0.25e-3, 50); // 9 u0. ExactAsmProp (6e -3); //6 m m 10 u0. SaveAsWf (" Parallel.wf"); // 11 RMatrix mat = CRMatrixY (45* DEG ); // y WaveField u1 (2048, 2048, 0.5e -6); // 13 u1. Rotate (u0, mat ); // ( ) 14 u1. SaveAsWf (" Rotation.wf"); // 15 } 振幅像 位相像 mm (Parallel.wf) 9 6mm 13 y RMatrix mat y wfl::crmatrixy() RMatrixY() CRMatrixY() 11 DEG π/180 DEG 2.14 振幅像 位相像 (Rotation.wf) x 15 y

53 2.5 ( ) RMatrix mat = CRMatrixY(45*DEG)*CRMatrixX(15*DEG); C mm 45 振幅像 位相像 (Rotation-c.wf) Example (: ExRotationalTransform-b.cpp) 1 # include <wfl.h> 2 using namespace wfl ; 3 4 void main () 5 { 6 Start (); 7 WaveField u0 (2048, 2048, 0.5e -6); // 2 K 2 K 0.5 m 8 u0. SetGaussian (0.25e-3, 50); // 9 u0. ExactAsmProp (6e -3); //6 m m 10 u0. SaveAsWf (" Parallel.wf"); // 11 RMatrix mat = CRMatrixY (45* DEG ); // y WaveField u1 (2048, 2048, 0.5e -6); // SFrequency cal ; // 15 u1. Rotate (u0, mat, & cal ); // ( c a l ) 16 u1. MultiplyPlaneWave ( cal ); // u1. SaveAsWf (" Rotation -c.wf"); // 19 } 14 Rotate() 3 SFrequency 16 MultiplyPlaneWave() Rotate()

54 WFL Example (: ExMultiThreading-a.cpp) 1 # include <wfl.h> 2 using namespace wfl ; 3 4 void main () 5 { 6 Start (); 7 StopWatch sw; 8 WaveField a (2048, 2048, 2e -6); 9 a. SetGaussian (2e -3, 50); // ===== ( ) 12 sw. Start (); // 13 a. ExactAsmProp (10e -3); // 14 sw. Stop (); // 15 printf ("% d : %f [s]\n", wfl :: GetNumThreads (), sw. Read ()); for ( int i = 2; i <= 4; i ++) 18 { 19 // ===== 20 sw. Reset (); 21 wfl :: SetNumThreads (i); // i 22 sw. Start (); // 23 a. ExactAsmProp (10e -3); // i 24 sw. Stop (); // 25 printf ("% d : %f [s]\n", wfl :: GetNumThreads (), sw. Read ()); 26 } 27 } 7 StopWatch 13 ExactAsmProp() WFL 21 wfl::setnumthreads() WFL Example *** WaveFieldLib <Intel C++/ Win32 / SSE1 > Rel CPU Core : 8 1 : [s] 2 : [s] 3 : [s] 4 : [s]... 4 Start() 8 wfl::setnumthreads() OpenMP WFL OpenMP OpenMP

55 WaveField void Start(int MsgLevel = 1) void Start(const char* fname) void Start(int MsgLevel, const char* fname) WaveField 1 MsgLevel MsgLevel 1 WaveField 1 2 fname 1 3 MsgLevel fname WaveFieldLib void PrintLog(const char* format,...) void PrintL(const char* format,...) void Printf(const char* format,...)

56 56 3 format & Start() format printf() format PrintLog() CPU PrintL() CPU Printf() printf() Example Start (3," log. txt "); WaveField wf (256, 256); float x = 1.0, y = 2.0; PrintLog ("PrintLog () x = %f, y = %f\n", x, y); PrintL (" PrintL () x = %f, y = %f\n", x, y); Printf (" Printf () printf () x = %f\n", x); Example ( ) *** WFL <Intel C++/ X64 / SSE1 > Rel [ PCNAME ] No. of Cores : 8 *** Build : Nov :13:13 Intel C++ Ver.15.00, Copyright K. Matsushima *** Logging Start from 2015/11/09 00:15:17, File : ( null ) >>> CPU Time : Sec (2008/05/13 15:25:38) <<< PrintLog () x = , y = s> PrintL () x = , y = Printf () printf () x = double GetTickSec() Start() CPU StopWatch FILE* GetLogFile(void) Start() 3.1.2

57 void SetNumThreads() void SetNumThreads(int n) WFL 1 CPU 2 n Start() 1 GetNumProcs() OMP omp get num procs() ()1 void PushNumThreads(int n) WFL n PopNumThreads() int PopNumThreads(void) PushNumThreads() int GetNumThreads(void) WFL Example SetNumThreads (); Printf ("% d ", GetNumThreads ()); void SetDynamicThreads(bool onoff) (onoff=true) (onoff=false)

58 58 3 bool GetDynamicThreads(void) int GetNumProcs(void) WFL Example SetNumThreads (); Printf ("% d ", GetNumProcs ()); / FFT / void* Malloc(size t size, const char* msg = NULL) malloc() 16 SSE ErrorCode MEMORY msg void Free(void* p) Malloc() p void SetFftLib(FftLib fl) FftLib fl FFT WFL FFT FFT MKL FFT WaveField Fft()

59 FftLib GetFftLib(void) FftLib FFT / WF void CreateFileMpWf(const char* fname, unsigned short int size) size WF fname / WaveField SaveAsMpWf() LoadMpWf() LoadParamMpWf() int GetSizeMpWf(const char* fname) fname WF void CreateFileSegWf(const char* fname, unsigned short int mx, unsigned short int my) mx my WF fname WF / WaveField SaveAsSegWf() LoadSegWf() LoadParamSegWf() int GetSizeSegWf(const char* fname, int& mx, int& my) fname WF mx my

60 void SetErrorHandling(ErrorHandling eh) WFL ( ) 2 ErrorHandling eh ErrorCode GetErrorString() WaveFieldException CONSOLE exit(1) ErrorHandling GetErrorHandling(void) ErrorHandling void Error(ErrorCode n, const char* funcname, const char* msg) ErrorCode n funcname msg WFL ERROR() ErrorCode GetErrorString() WFL ERROR1(n) WFL ERROR(n, msg). ErrorCode n 2 msg ErrorCode GetErrorString()

61 #define WFL ERROR1(n) Error(n, FUNCTION ) #define WFL ERROR(n) Error(n, FUNCTION, msg) const char* GetErrorString(ErrorCode n) ErrorCode n ErrorCode int GetMajorVersion(void) int GetMinorVersion(void) int GetPatchNumber(void) WFL xx.yy.zz xx yy zz const char* GetVersionString(void) xx.yy.zz WFL Platform GetPlatform(void) Platform WFL const char* GetPlatformString(void) WFL

62 62 3 DevelopEnv GetCreateEnv(void)) DevelopEnv WFL const char* GetCreateEnvString(void) WFL DevelopEnv GetDevelopEnv(void) DevelopEnv const char* GetDevelopEnvString(void) DevelopEnv GetTargetEnv(void) DevelopEnv WFL const char* GetTargetEnvString(void) WFL CpuType GetCpuType(void) CpuType WFL CPU

63 const char* GetCpuTypeString(void) CPU WFL CPU const char* GetCreateEnvVersionString(void) WFL const char* GetCreateTimeStamp(void) WFL void SetPositionTolerance(double t) const double& GetPositionTolerance(void) [m] const RMatrix& RMatrixX(double t) const RMatrix& RMatrixY(double t) const RMatrix& RMatrixZ(double t) RMatrix x y z t[rad] RMatrix RotationX()

64 64 3 const RMatrix& CRMatrixX(double t) const RMatrix& CRMatrixY(double t) const RMatrix& CRMatrixZ(double t) RMatrix x y z t[rad] RMatrix CRotationX() InterpolFunc GetInterpolFunc(Interpol interpol) InterpolFunc WaveField Interpol void SetRandomSeed(int s) WaveField SetRandomPhase() ModRandomPhase() s s = InterpolFunc WaveField GetInterpolFunc() typedef Complex (WaveField::*InterpolFunc)(double x, double y) const const double Pi π Example

65 3.2 FieldParam 65 double angle = Pi /2; // 9 0 PI π const double Deg (degree) π/180 Example Phase phs = 15* Deg // 1 5 double angle = 90* Deg ; // 9 0 DEG (degree) π/ FieldParam PointArray Plane FieldParam FieldParam 2 ( ) Plane PointArray WaveField WaveField FieldParam GetWavelength() SetWavelength() GetWavenumber() SetWavenumber() N() GetN() GetNx() GetNy() SetNx() SetNy() GetPx() GetPy() SetPx() SetPy() ( Plane ) GetOrigin() SetOrigin() GetNormalVector() SetNormalVector()

66 O N N O O N N WaveField WaveField 2 WaveField 3.1 O 3.1 WaveField WFL3 WaveField FieldParam FieldParam Plane PointArray Plane FieldParam WaveField WFL3 Plane += *= WaveField WaveField 2 (i, j) 2 (0, 0) (N x 1, N y 1) N x N y x y (x, y) (i, j) (x, y) ( x = i N ) x P x 2 ( y = i N ) y P y 2 (3.1) x i = N x 2 P x (3.2)

67 3.3 WaveField 67 y j = P y N y 2 ξ ξ O O O 2 O O 2 N N O O O O F E N A 2 O N O O 2 O N N N 2 N N N F E N A N N N 2 N 3.2 (i, j) (x, y) X() Y() (x, y) (i, j) I() J() ( (ˆx, ŷ)) GetOrigin() SetOrigin() z GetNormalVector() SetNormalVector() ẑ WaveField (i, j) top, bottom, right, left 3.3 bottom left top right top 1 right 1 ( )

68 WaveField(void) WaveField(int nxy) WaveField(int nx, int ny) WaveField(int nx, int ny, double pxy) WaveField(int nx, int ny, double px, double py) WaveField(int nx, int ny, double px, double py, double wavelength) 1 2 x y nxy 3 x nx y nx x, y p [ :m] 4 x y px py 5 wavelength [ :m] () N x = N y = 256 P x = P y = 1µm λ = 632.8nm Example //

69 3.3 WaveField 69 WaveField wf1 ; // 512 x WaveField wf2 (512); // 1024 x x, y 1 0 u m WaveField wf3 (1024, 1024, 10e -6); // 2048 x x 5 u m y 1 0 u m WaveField wf3 (2048, 2048, 5e -6, 10e -6); WaveField(const WaveField& wf); ~WaveField(void) WaveField void Dispose(void) WaveField WaveField& Init(Complex* d = NULL) WaveField d NULL d NULL d ( ) Clear() x 4 4 d d=null N x N y WaveField SSE 16 wfl::malloc() 16

70 70 3 WaveField& InitNxNy(void) 2 Init() x 4 4 Complex* GetDataPointer(void) WaveField& Clear(void) WaveField 0 WaveField& CopyParam(const WaveField& source) WaveField N x N y source N x N y SetNx() SetNy() Init() WaveField& CopyData(const WaveField& source) WaveField source N x N y N x N y

71 3.3 WaveField () WaveField:: WaveField static void SetDefault(long nxy) static void SetDefault(long nx, long ny) static void SetDefault(long nx, long ny, double pxy) static void SetDefault(long nx, long ny, double px, double py) static void SetDefault(long nx, long ny, double px, double py, double lmd) 1 nxy N x N y 2 nx ny N x N y 3 2 pxy P x P y 4 2 px py P x P y 5 4 lmd static void SetDefaultWavelength(double lmd) lmd static double GetDefaultWavelength(void) static void SetDefaultNx(long nx) static void SetDefaultNy(long ny) nx ny N x N y

72 72 3 static long GetDefaultNx(void) static long GetDefaultNy(void) N x N y static void SetDefaultPx(double px) static void SetDefaultPy(double py) px py P x P y static double GetDefaultPx(void) static double GetDefaultPy(void) P x P y Example // WaveField :: SetDefault (1024, 1); // wf1, w f x e -6 x1e -6, nm WaveField wf1, wf2 ; // 1024 x WaveField :: SetDefault (1024, 1024); WaveField a; // a b x e -6 x1e nm WaveField b; WaveField :: SetDefualtPy (10e -6); WaveField c (512, 1024); // c x e -6 x10e nm WaveField :: SetDefualtWavelength (532e -9); WaveField c, d, e; // c, d, e x e -6 x10e nm bool IsRealSpace(void) const bool IsComplexAmplitude(void) const ( ) true

73 3.3 WaveField 73 bool IsFourierSpace(void) const bool IsSpectrum() const () true bool IsComplexForm(void) const true ComplexForm bool IsPolarForm(void) const true ComplexForm double GetWavelength(void) const WaveField LightWave& SetWavelength(double lambda) lambda WaveField

74 74 3 double GetWavenumber(void) const WaveField WaveField& SetWavenumber(double k) k WaveField float& k(void) WaveField LightWave long long N(void) const long long GetN(void) const WaveField GetNx()*GetNy() const long& GetNx(void) const const long& GetNy(void) const x y x y WaveField& SetNx(long n) WaveField& SetNy(long n) n x y

75 3.3 WaveField 75 Init() Example WaveField wf; // w f wf. SetNx (512); // x wf. SetNy (1024); // y wf. Init (); // w f long& Nx(void) long& Ny(void) x y int LightWave Init() const double& GetPx(void) const const double& GetPy(void) const x y WaveField& SetPx(double pitch) WaveField& SetPy(double pitch) pitch x y Example WaveField wf; // w f wf. SetPx (100e -6); // x u m wf. SetPx (50e -6); // y 5 0 u m double& Px(void) double& Py(void) double x y

76 76 3 LightWave Complex& operator[](int i) 1 i Example WaveField wf; Complex a; a = wf [10]; // 10 a wf [15]= Comp (1.0, 0.5); // i Complex GetValue(int i, int j) const Complex GetPixel(int i, int j) const Complex (i, j) Example WaveField wf; Complex c = wf. GetValue (10, 15); // (10,15) WaveField& SetValue(int i, int j, Complex val) WaveField& SetPixel(int i, int j, Complex val) (i, j) Complex val Example WaveField wf; wf. SetValue (10, 15, Complex (1.0, 0.5); // (10,15) i Complex& Value(int i, int j) Complex& Pixel(int i, int j) Complex (i, j)

77 3.3 WaveField 77 LightWave Example WaveField wf; wf. Value (10, 15) = Complex (1.0, 0.5); // (10,15) i double GetReal(int i, int j) const double GetImag(int i, int j) const (i, j) Example WaveField wf; double re = wf. GetReal (10, 50); // (10,50) double im = wf. GetImag (10, 50); // (10,50) WaveField& SetReal(int i, int j, double val) WaveField& SetImag(int i, int j, double val) (i, j) val Example WaveField wf; wf. SetReal (10, 50, 0.53); // (10,50) wf. SetImag (10, 50, 0.0); // (10,50) 0 float& Real(int i, int j) float& Imag(int i, int j) (i, j) LightWave Example float g = wf. Real (10, 50); // (10,50) wf. Real (23, 1) = 10 * g; // (32,1) wf. Imag (23, 1) *= 3; // (23,1) 3

78 78 3 double GetAmplitude(int i, int j) (i, j) void SetAmplitude(int i, int j, double val) (i, j) val Phase GetPhase(int i, int j) Phase (i, j) π +π void SetPhase(int i, int j, double val) (i, j) val double GetIntensity(int i, int j) ( 2 ) (i, j) ( 2 ) void SetIntensity(int i, int j, double val) (i, j) ( 2 )

79 3.3 WaveField WaveField& SetConst(const Complex& c) WaveField& SetConstReal(double a) WaveField& SetConstImag(double b) WaveField& SetConstAmplitude(double A) WaveField& SetConstPhase(double p) WaveField& SetConstWin(const Complex& c) WaveField& SetConstWinReal(double a) WaveField& SetConstWinImag(double b) WaveField& SetConstWinAmplitude(double A) WaveField& SetConstWinPhase(double p) double X(int i) const x i x i double Y(int j) const y j y j int I(double x) const i x i x

80 80 3 int J(double y) const j y j y int IJ(int i, int j) const 1 i j 1 double GetMaxX(void) const double GetMinX(void) const double GetMaxY(void) const double GetMinY(void) const () double GetWidth(void) const x ( :m) x double GetHeight(void) const y ( :m) y double GetMaxX(void) const double GetMinX(void) const double GetMaxY(void) const double GetMinY(void) const ()

81 3.3 WaveField WaveField& ShiftZeroFill(Axis axis, double dxy) WaveField& ShiftZeroFill(double dx, double dy) x y 1 Axis axis dxy 2 x dx y dy WaveField& ImageRotation(int n) 90 (n=1) 180 (n=2) 270 (n=3) Rotate() RotateFs() WaveField& SwitchQuadrant(void) FFT WaveField& Transpose(bool interval = true) x y interval=true

82 82 3 WFL RECT& Window(void) WFL RECT WFL RECT WFL RECT Example WaveField wf (64, 64); /* */ wf. Window (). left = 10; wf. Window (). right = 20; wf. Window (). top = 10; wf. Window (). bottom = 5; /* */ int width = wf. Window (). right - wf. Window (). right ; int height = wf. Window (). top - wf. Window (). bottom ; WaveField& SetWindow(const WFL RECT& r) WFL RECT r r.left, r.right, r.top, r.bottom WFL RECT MSDN Example WaveField wf (64, 64); WFL_RECT r; r. left =10; r. right 20; r. top = 10; r. bottom = 5; wf. SetWindow (r); WaveField& SetWindow(int left, int right, int bottom = 0, int top = 0) (i, j) WaveField& SetWindow(double left, double right, double bottom = 0.0, double top = 0.0) (x, y) WaveField& SetWindowMax(void)

83 3.3 WaveField 83 WaveField& SetWindowCommon(WaveField& signal) signal WaveField& TransferWindow(WaveField& source) source WaveField WaveField& operator=(const WaveField& wf) WaveField& operator*=(const WaveField& wf) WaveField& operator/=(const WaveField& wf) WaveField& operator+=(const WaveField& wf) WaveField& operator-=(const WaveField& wf) WaveField 2 C WaveField N x N y WaveField 2 Example WaveField wf1, wf2 ; wf1 *= wf2 ; // w f 1 w f 2 w f 1

84 84 3 WaveField& operator*=(double val) WaveField& operator*=(const ComplexDouble& val) WaveField& operator/=(double val) WaveField& operator/=(const ComplexDouble& val) WaveField& operator+=(const ComplexDouble& val) WaveField& operator-=(const ComplexDouble& val) double ComplexDouble val C Example WaveField wf; wf *= Complex (3.0, 2.0); // w f i WaveField& SetNormalVector(Vector v) Vector v Vector GetNormalVector(void) const Vector void SetCenter(Point p) void SetOrigin(Point p) Point p Point GetCenter(void) const Point GetOrigin(void) const Point

85 3.3 WaveField 85 Vector GetUnitVectorX(void) const Vector GetUnitVectorY(void) const Vector x y RMatrix GetCRMatrixLG(void) const RMatrix RMatrix GetCRMatrixGL(void) const RMatrix Point GetLocalPosition(Point p) const Point p Point GetGlobalPosition(Point p) const Point p Plane GetPlane(void) const Plane

86 86 3 Line GetOpticalAxis(void) const Line PointArray GetFrame(int n = 0) const PointArray ( ) n = 0 n 1 2 n x y [1/m] u v z (3.10) w WaveField WaveField& Add(const WaveField& wf) WaveField& Multiply(const WaveField& wf) wf 2 1 source wf ResamplingAdd() ResamplingMultiply() wf Mutiply() 0 Add()

87 3.3 WaveField 87 WaveField& ResamplingAdd(const WaveField& wf, Interpol ip = CUBIC8) WaveField& ResamplingMultiply(const WaveField& wf, Interpol ip = CUBIC8) wf Interpol ip Add() Multiply() source wf Add() Multiply() wf Multiply() Add() WaveField& ResamplingCopy(const WaveField& source, Interpol ip = CUBIC8, bool clear = true) source Interpol ip clear=true source source source source clear=true

88 88 3 void SaveAsGrayBmp(const char* fname, Mode mode, int depth = 8, double gamma = 2.2) const fname depth BMP Mode mode gamma SaveAsBmp() INTENSITY depth 1, 4, 8 depth = P x P y BMP void SaveAsBmp(const char* fname, Mode mode, Gradation cs = GRAY) const void SaveAsBmp(const char* fname, Mode mode, Gradation cs, int cw) const void SaveAsBmp(const char* fname, Mode mode, Gradation cs, int cw, double max, double min = 0.0) const fname 8 BMP BMP WaveField Mode mode Gradation cs 1 cs cs COLOR 2 cw 3 SaveAsGrayBmp() INTENSITY Gradation cs = GRAY cs = COLOR 10 min max min 0( ) max 255( ) min max 3.1 P x P y BMP

89 3.3 WaveField SaveAsBmp() Mode ( ) INTENSITY AMPLITUDE PHASE π +π REAL IMAGINARY Example WaveField wf (1024, 1024, 10e -6); wf. SetGaussian (5e -3); wf. SaveAsBmp (" Gaussian1. bmp ", PHASE ); // wf. SaveAsBmp (" Gaussian2. bmp ", AMPLITUDE, COLOR, 0); // void WinSaveAsGrayBmp(const char* fname, Mode mode, int depth = 8, double gamma = 2.2) const BMP SaveAsGrayBmp() void WinSaveAsBmp(const char* fname, Mode mode, Gradation cs = GRAY) const void WinSaveAsBmp(const char* fname, Mode mode, Gradation cs, int cw) const void WinSaveAsBmp(const char* fname, Mode mode, Gradation cs, int cw, double max, double min = 0.0) const BMP SaveAsBmp() void SaveAsRgbBmp(const char* fname, const WaveField& green, const WaveField& blue, const Mode mode, double min = 0.0, double max = 0.0) const green blue Mode mode fname 32 BMP SaveAsBmp()

90 90 3 ( ) green bule ( ) green bule min max min 0 max 255 min max 3.1 P x P y BMP void WinSaveAsRgbBmp(const char* fname, const WaveField& green, const WaveField& blue, const Mode mode, double min = 0.0, double max = 0.0) const green blue Mode mode fname 32 BMP SaveAsRgbBmp() void SaveAsSegBmp(const char* fname, Mode mode, int mx, int my, Gradation cs = GRAY) const fname mx my Gradation cs BMP SaveAsBmp() cs = COLOR BMP SegWaveField SaveAsSegBmp() WaveField& LoadBmp(const char* fname, Mode mode, Complex backg = Comp(0, 0), double gamma = 1.0, ColorMode cm = GRAY SCALE) name BMP BMP WaveField Mode mode backg gamma ColorMode cm GRAY SCALE 8 RED GREEN BLUE 8

91 3.3 WaveField 91 WFL Rel 3.5 gamma WFL gamma 2.2 BMP WaveField BMP / BMP BMP BMP BMP WaveField BMP 2 2 BMP 3.2 WaveField backg cm 3.2 LoadBmp() , 1 Mode INTENSITY AMPLITUDE PHASE π +π 1 REAL IMAGINARY Example WaveField wf, r, g, b; wf. LoadBmp (" photo. bmp ", INTENSITY ); // r. LoadBmp (" photo. bmp ", INTENSITY, 0, RED ); // g. LoadBmp (" photo. bmp ", INTENSITY, 0, GREEN ); // b. LoadBmp (" photo. bmp ", INTENSITY, 0, BLUE ); //

92 92 3 void SaveAsCsv(const char* fname, Axis axis = X AXIS, int ij = 0) const ij x y 1 CSV fname Excel Axis axis x j = 0 SetWindowMax() Example SaveAsCsv() # include <wfl.h> using namespace wfl ; void main ( void ) { Start (); WaveField a (512, 512, 10e -6); a. Clear (); a. SetConstAmplitude (1.0); // 1. 0 a. SetQuadraticPhase (200e -3); // m m (2 ) a. SaveAsCsv (" Lens1. csv "); // x j =0 a. SaveAsCsv (" Lens2. csv ", Y_AXIS, a.j (0.0)); // y x =0.0( j=nx /2) } void SaveAsWf(const char* fname) const ( ) fname WF WF WaveField WF LW WF WF void WinSaveAsWf(const char* fname) const fname WF WaveField& LoadWf(const char* fname)

93 3.3 WaveField 93 fname WF void SaveAsMpWf(const char* fname, unsigned short int ix) const fname WF ix WF 1 CreateFileMpWf() CreateFileMpWf() GetSizeMpWf() LoadParamMpWf() WaveField& LoadMpWf(const char* fname, unsigned short int ix, bool* exist = NULL) fname WF ix bool exist ix *exist == false *exist == false WaveField& LoadParamMpWf(const char* fname, unsigned short int ix, bool* exist = NULL) fname WF ix bool exist ix *exist == false

94 94 3 void SaveAsSegWf(const char* fname, unsigned short int ii, unsigned short int jj) const fname WF (ii, jj) WF (Segmented WF ) (0,0) 2 WF WF CreateFileSegWf() CreateFileSegWf() WF GetSizeSegWf() WF LoadParamSegWf() void SaveParamSegWf(const char* fname) const fname WF fname WF CreateFileSegWf() CreateFileSegWf() WaveField& LoadSegWf(const char* fname, unsigned short int ii, unsigned short int jj, bool* exist = NULL) fname WF (ii, jj) bool exist (ii, jj) *exist == false *exist == false

95 3.3 WaveField 95 WaveField& LoadParamSegWf(const char* fname, unsigned short int ii, unsigned short int jj, bool* exist = NULL) fname WF (ii, jj) bool exist (ii, jj) *exist == false (ii, jj) void SaveAsLw(const char* fname, OptionHead* ohh = NULL) const fname LW LW WaveField ohh NULL ohh LW LW WF SaveAsWf() LW WaveField void WinSaveAsLw(const char* fname, OptionHead* ohh = NULL) const LW SaveAsLw() WaveField& LoadLw(const char* fname, OptionHead* ohh = NULL) LW fname ohh NULL ohh LW ohh LW WF LoadWf() LW WaveField 0

96 ohh void SaveAsText(const char* fname, int j = 0) const j fname Excel SetWindowMax() void SaveAsPTF(const char* fname) const void SaveAsDE(const char* fname) const WaveField& LoadDE(const char* fname) void SaveAsCA(const char* fname) const WaveField& LoadCA(const char* fname) void SaveAsHBI(...) const WaveField& LoadHBI(...) void SaveAsText(const char* fname, int j = 0) const j fname Excel SetWindowMax()

97 3.3 WaveField WaveField& ConvToPolarForm(void) WaveField& ConvToComplexForm(void) WaveField& ConvToIntensity(void) 0.0 WaveField& ConvToLogIntensity(void) 0.0 WaveField& ConvToAbsolute(void) 0.0

98 98 3 WaveField& ConvToConjugate(void) WaveField& Normalize(float max = 1.0) max WaveField& NormalizeWin(float max = 1.0) max ( ) WaveField& Fft(int s) F (k u, l v) = M m N n [ ( km f(m x, n y) exp s i2π M + ln )] N (3.3) s 1 +1 x y u v u = 1 M x v = 1 N y P x P y u v M N x y N x N y P x 1 P x N x P y 1 P y N y (3.4) (3.5)

99 3.3 WaveField 99 N x N y ComplexForm COMPLEX SPECTRUM SPECTRUM COMPLEX IsComplexAmplitude() IsSpectrum() FFT FFT SetFftLib() GetFftLib() Example WaveField wf; wf. LoadWf (" sample.wf") wf. SaveAsBmpP (" sample. bmp ", PHASE ); // wf.fft ( -1); // wf. SaveAsBmp (" samples. bmp ", PHASE ); // wf.fft (1); // wf /= wf. GetN (); // wf. SaveAsBmp (" sample1. bmp ", PHASE ); // WaveField& FakeFft() (3.5) ComplexForm COMPLEX SPECTRUM SPECTRUM COMPLEX IsComplexAmplitude() IsSpectrum() WaveField& ScaledFft(double ax, double ay) Scaled FFT [3] F (k u, l v) = M m N n [ ( km f(m x, n y) exp i2π M ax + ln )] N ay Fft() ax ay (3.6)

100 100 3 x y u v u = ax M x v = ay N y (3.7) P x P y u v M N x y N x N y P x ax (3.8) P x N x P y ay P y N y ax = ay = 1 ax = ay = 1 Fft() 4N x N y FFT 3 Fft() FFT SetFftLib() GetFftLib() ComplexForm COMPLEX SPECTRUM SPECTRUM COMPLEX IsComplexAmplitude() IsSpectrum() WaveField& AsmProp(double d) [2] d [m] ( ) Fresnel d 10cm Embed() Extract() () ExactAsmProp() ExactAsmProp() 1/4 Example WaveField wf; wf. LoadWf (" sample.wf"); wf. AsmProp (10e -3); //

101 3.3 WaveField 101 wf. Normalize (); wf. SaveAsWf (" sample1.wf"); // Example WaveField wf; wf. LoadWf (" sample.wf"); wf. Embed (1); wf. AsmProp (10e -3); wf. Extract (1) wf. Normalize (); wf. SaveAsWf (" sample1.wf"); // // // // WaveField& AsmPropFs(double d) [2] ( ) d [m] ( ) Fresnel d 10cm AsmProp() FFT Embed() FFT Extract() Example WaveField wf; wf. LoadWf (" sample.wf"); wf.fft ( -1); wf. AsmPropFs (10e -3); wf.fft (1); wf. Normalize (); wf. SaveAsWf (" sample1.wf"); // // // // WaveField& ExactAsmProp(double d) [2] d [m] ( ) Fresnel d AsmProp() AsmProp() 4 AsmProp() Example

102 102 3 WaveField wf; wf. LoadWf (" sample.wf"); wf. EactAsmProp (10e -3); wf. Normalize (); wf. SaveAsWf (" sample1.wf"); // // WaveField& ShiftedAsmProp(const WaveField& source, int prec = 1) source prec [4] x, y source z P x P y ShiftedFresnelProp() ShiftedFresnelProp() prec prec Example WaveField a, b; a. LoadWf (" input.wf"); b. CopyParam (a); a. SetOrigin ( Vector (0, 0, 0)); // a (0, 0, 0) b. SetOrigin ( Vector (10e -3, 10e -3, 50e -3)); // b (10, 10, 50)[ mm] b. ShiftedAsmProp (a); // a b b b. SaveAsWf (" result.wf"); WaveField& ShiftedAsmPropAdd(const WaveField& source, int prec = 1) source prec [4] ShiftedAsmProp() P x P y

103 3.3 WaveField 103 WaveField& ShiftedAsmPropEx(const WaveField& source) source ShiftedAsmProp() source WaveField& ShiftedAsmPropAddEx(const WaveField& source) source [4] ShiftedAsmPropAdd() source WaveField& FresnelProp(double d) Fresnel d [m] ( ) d Fresnel WaveField& FourierProp(double f) f [m] 2f ( ) WaveField& BackFourierProp(double f) f [m] 2f ()

104 104 3 WaveField& ShiftedFresnelProp(const WaveField& source) WaveField& ShiftedFresnelProp(const WaveField& source, const ShiftedFresnelPropDescriptor& sfpd) WaveField& ShiftedFresnelProp(const Vector& origin, double px, double py) WaveField& ShiftedFresnelProp(const Vector& origin, double px, double py, const ShiftedFresnelPropDescriptor& sfpd) 1 2 source [5] source (out-place ) 3 4 origin px py (in-place ) 2 4 ShiftedFresnelPropDescriptor sfpd x, y P x P y out-place source z in-place origin ShiftedFresnelPropEx() ShiftedFresnelAdd() Example out-place WaveField a, b; a. LoadWf (" input.wf"); a. SetOrigin ( Vector (0, 0, 0)); // a (0, 0, 0) b. SetOrigin ( Vector (10e -3, 10e -3, 100e -3); // b (10, 10, 100)[ mm] b. ShiftedFresnelProp (a); // a b b b. SaveAsWf (" result.wf"); Example out-place WaveField a; a. LoadWf (" input.wf"); a. SetOrigin ( Vector (0, 0, 0)); // a (0, 0, 0) double d = 100e -3, px = 5e -6, py = 3e -6; SetDefault (a. GetNx (), a. GetNy (), px, py, a. GetWavelength ()); WaveField b, c, d; b. SetOrigin ( Vector (10e -3, 0, d )); c. SetOrigin ( Vector ( -10e -3, 0, d )); d. SetOrigin ( Vector (0, 10e -3, d )); // ShiftedFresnelDescriptor sfpd (d, px, py, a); // b. ShifteFresnelProp (a, sfpd ); // a b c. ShifteFresnelProp (a, sfpd ); // a c d. ShifteFresnelProp (a, sfpd ); // a d b. SaveAsWf (" result -b.wf"); c. SaveAsWf (" result -c.wf"); d. SaveAsWf (" result -d.wf"); Example in-place WaveField a;

105 3.3 WaveField 105 a. LoadWf (" input.wf"); a. SetOrigin ( Vector (0, 0, 0)); // a (0, 0, 0) a. ShiftedFresnelProp ( Vector (10e -3, 10e -3, 100e -3, a. GetPx ()/2, a. GetPx ()); // a a. SaveAsWf (" result.wf"); WaveField& ShiftedFresnelPropAdd(const WaveField& source, const ShiftedFresnelPropDescriptor& sfpd) source WaveField& ShiftedFresnelPropEx(const WaveField& source) source ShiftedFresnelProp() source WaveField& ShiftedFresnelPropAddEx(const WaveField& source) source 1 ShiftedFresnelPropAdd() source WaveField& Rotate(const WaveField& source, RMatrix& crmat, SFrequency* c = NULL, Interpol ip = CUBIC8, bool Jacobian = false) source RMatrix crmat SFrequency c NULL *c

106 106 3 Interpol ip Jacobian = true [6, 7] WaveField& RotateFs(const WaveField& source, RMatrix& crmat, SFrequency* c = NULL, Interpol ip = CUBIC8, bool Jacobian = false) source [6, 7] source RMatrix crmat SFrequency c NULL *c Interpol ip Jacobian = true Example RMatrix rm = CRMatrixY (15* Deg ); // y 1 5 WaveField a, b; a. LoadWf (" input.wf"); a. Fft ( -1); // a b. FakeFft (); // b b. RotateFs (a, rm ); // a b b. Fft (1); // b b/=b. GetN (); b. SaveAsWf (" result.wf"); WaveField& SetGaussian(double w, double n = 2.0, double a = 1.0) 0 w [m] 1/e n a [ ( ) n ] x2 + y f(x, y) = a exp 2 w n = 2 n > 2 WaveField& SetEllipticGaussian(double rx, double ry, double n = 2.0, double a = 1.0) 0 rx [m]

107 3.3 WaveField 107 ry [m] x y 1/e n a ( ( ) f(x, y) = a exp x 2 2 y + rx) ry n = 2 n WaveField& SetSeparableGaussian(double wx, double wy, double nx = 2.0, double ny = 2.0, double a = 1.0) wx [m] wy [m] x y 1/e nx ny a [ ( x ) nx ( ] y ny f(x, y) = a exp wx wy) n = 2 n > 2 WaveField& SetRect(double wx, double wy, double a = 1.0); x wx [m] y wy [m] a 0 0 WaveField& AddSphericalWave(Point p, Phase phs, double a, WindowFunc w) WaveField& AddSphericalWave(Point p, Phase phs, double a) WaveField& AddSphericalWave(Point p) Point p a ( ) Phase phs WindowFunc w

108 108 3 WaveField& AddSphericalWaveSqr(const SphericalWaveDescriptor& swd, double x, double y, double z, double a = 1.0, double InitPhase = 0, WindowFunc w = RECTANGLE) SphericalWaveDescriptor swd (x, y, z) a InitPhase(= 0 2π) ( ) WindowFunc w ( RECTANGLE ) InitPhase 0 2π InitPhase SphericalWaveDescriptor swd Example WaveField wf (512, 512); // SphericalWaveDescriptor sfd ( wf. GetWavelength (), wf. GetPx (), wf. GetPy (); wf. Celar (); wf. AddSphericalWaveRF (sfd, 0.1e -3, -0.1e -3, -1e -3); // wf. AddSphericalWaveRF (sfd, -0.1e -3, 0.1e -3, -1e -3); // WaveField& SetRandomPhase(int m = 1) 1 m = 1 (Mersenne twister) C rand() wfl::setrandomseed() WaveField& ModRandomPhase(int m = 1) SetRandamPhase() m = 1 (Mersenne twister) C rand() wfl::setrandomseed()

109 3.3 WaveField 109 WaveField& SetQuadraticPhase(double f) f 2 WaveField& MultiplyQuadraticPhase(double f) f 2 WaveField& MultiplyPlaneWave(double CosA, double CosB, Phase phs = 0.0) WaveField& MultiplyPlaneWave(Vector dir, Phase phs = 0.0) WaveField& MultiplyPlaneWave(SFrequency f, Phase phs = 0.0) 1 x CosA y CosB phs 2 dir phs 3 SFrequency f phs 2 dir phs WaveField& SetPlaneWave(double CosA, double CosB, Phase phs = 0.0) WaveField& SetPlaneWave(Vector dir, Phase phs = 0.0) WaveField& SetPlaneWave(SFrequency f, Phase phs = 0.0) 1 x CosA y CosB phs 2 dir phs 3 SFrequency f phs 1 2 dir phs

110 double GetSquareSum(void) const ( 2 ) ( 2 ) double GetSquareSumWhole(void) const ( 2 ) ( 2 ) double GetSquareAverage(void) const ( 2 ) ( 2 ) double GetAbsoluteSum(void) const double GetAmplitudeSum(void) const () () double GetAbsoluteAverage(void) const double GetAmplitudeAverage(void) const () ()

111 3.3 WaveField 111 double GetAbsoluteMax(void) const double GetAmplitudeMax(void) const () () double GetAmplitudeMaxWhole(void) const () () double GetAmplitudeVariance(void) const () () ComplexDouble GetScaleFactor(const WaveField& signal) const signal f(x, y) f sig (x, y) f(x m, y n ) αf sig (x m, y n ) 2 (m,n) W α f(x m, y n )fsig(x m, y n ) α = (m,n) W (m,n) W f sig (x m, y n ) 2 W signal signal ( 3.4 ) double GetSnr(const WaveField& signal, const ComplexDouble& scalefactor) const S/N signal S/N scalefactor signal signal

112 112 3 ( 3.4) GetScaleFactor() 3.4 GetSnr() double GetEnergyRatioInWindow(void) const ( 1.0) WaveField& CreateRealHistogram(int level = 512) const 1 WaveField level 1 WaveField 2 1 WaveField 1 WaveField Px level Example WaveField wf (512, 512); // wf. SetSphericalWave (0, 0, 10e -3); // WaveField hist ; // hist = wf. CreateRealHistogram (); // float max = hist. Real (0,0); // int i; for (i = 0; i < hist. Nx (); i++) if ( max > hist. Real (i, 0)) max = hist. Real (i, 0);

113 3.3 WaveField 113 double GetOverlapFactor(const WaveField& sig) const sig WaveField& HardClipPhase(int level) level π π WaveField& HardClipAmplitude(int level) level WaveField& PartialClipPhase(int level, double epsilon) level π π epsilon 3.5 ε ε = 0.5 WaveField& PartialClipAmplitude(int level, double epsilon) level epsilon 3.5 ε

114 N A A N 3.5 ε = Complex GetInterpolVal(double x, double y, Interpol ip = CUBIC8) const Complex GetInterpolVal(double x, double y, InterpolFunc intfunc = &Cubic8Interpol) const 1 Interpol ip (x, y) 2 InterpolFunc intfunc Interpol CUBIC8 [8] GetInterpolFunc() Complex Cubic8Interpol(double x, double y) const Complex Cubic6Interpol(double x, double y) const Complex Cubic4Interpol(double x, double y) const Cubic [8] (x, y) Interpol CUBIC8 CUBIC6 CUBIC4

115 3.3 WaveField 115 Complex LinearInterpol(double x, double y) const (x, y) Interpol LINEAR Complex AdjacentInterpol(double x, double y) const (x, y) Interpol ADJACENT Complex BiLinear(double x, double y) const (x, y) Interpol BILINEAR Complex BiCubic(double x, double y) const (x, y) Interpol BICUBIC Complex NearestNeighbor(double x, double y) const (x, y) Interpol NEAREST NEIGHBOR

116 m mxy=1 2(= 2 1 ) mxy=2 4(= 2 2 ) WaveField& Replicate(int mxy = 1) WaveField& Replicate(int mx, int my) 1 x y 2 mxy ( 3.6) 2 x 2 mx y 2 my 3.6 Replicate() WaveField& EnlargeZeroFill(int mxy = 1) WaveField& EnlargeZeroFill(int mx, int my) 1 x y 2 mxy 0 ( 3.7) 2 x 2 mx y 2 my

117 3.3 WaveField EnlargeZeroFill() 3.8 Embed() WaveField& Embed(int mxy = 1) WaveField& Embed(int mx, int my) 1 x y 2 mxy 0 ( 3.8) 2 x 2 mx y 2 my WaveField& Extract(int mxy = 1) WaveField& Extract(int mx, int my) 1 x y 2 mxy 1 ( 3.9) 2 x 2 mx 1 y 2 my 1

118 Extract() WaveField& ReduceByAverage(int mxy = 1) WaveField& ReduceByAverage(int mx, int my) 1 x y 2 mxy 1 2 x 2 mx 1 y 2 my 1 mxy mx my WaveField& ReduceByThinning(int mxy = 1) WaveField& ReduceByThinning(int mx, int my) 1 x y 2 mxy 1 2 x 2 mx 1 y 2 my 1 mxy mx my WaveField& ExtractWindow(const WaveField& source, Complex backg = Complex(0.0, 0.0)) source source 2

119 3.3 WaveField 119 source N x N y WaveField& Subdivide(int mxy = 1) WaveField& Subdivide(int mx, int my) WaveField& Pixelation(int mxy = 1) WaveField& Pixelation(int mx, int my) 1 x y 2 mxy ( 3.10) 2 x 2 mx y 2 my 1 x y 2 mxy 1 2 x 2 mx 1 y 2 my Subdivide() & Pixelation() WaveField& DrawLine(int x1, int y1, int x2, int y2, const Complex& val = Comp(1.0, 0.0)) (x1, y1) (x2, y2) val WaveField& Paint(int x, int y, const Complex& val = Comp(1.0, 0.0)) (x, y) val val

120 120 3 WaveField& PaintTriangle(int x1, int y1, int x2, int y2, int x3, int y3, const Complex& val = Comp(1.0, 0.0)) WaveField& PaintTriangle(const PointArray& pa, const Complex& val = Comp(1.0, 0.0)) 1 (x1, y1), (x2, y2), (x3, y3) val 2 PointArray pa 3 (x, y) val z Complex/ComplexDouble Complex ComplexDouble Complex ComplexDouble Complex(const float& a = 0.0, const float& b = 0.0) ComplexDouble(double a = 0.0, double b = 0.0) Complex(const ComplexDouble& c) ComplexDouble(const Complex& c) Complex ComplexDouble

121 3.4 Complex/ComplexDouble 121 void SetReal(double a) a double GetReal(void) const float& real(void) double& real(void) void SetImag(double b) b double GetImag(void) const float& imag(void) double& imag(void) double GetAmplitude(void)

122 122 3 void SetAmplitude(double val) Phase GetPhase(void) Phase π +π void SetPhase(double val) double GetIntensity(void) ( 2 ) ( 2 ) void SetIntensity(double val) ( 2 ) void Comp(float a = 0.0, float b = 0.0) a b

123 3.4 Complex/ComplexDouble 123 Complex Conjugate(void) const Complex& operator=(const Complex& c) Complex& operator=(const ComplexDouble& c) ComplexDouble& operator=(const Complex& c) ComplexDouble& operator=(const ComplexDouble& c) Complex& operator+=(const Complex& c) Complex& operator-=(const Complex& c) ComplexDouble& operator+=(const ComplexDouble& c) ComplexDouble& operator-=(const ComplexDouble& c) Complex& operator*=(const Complex& c) Complex& operator*=(double c) ComplexDouble& operator*=(const ComplexCouble& c) ComplexDouble& operator*=(double c) Complex& operator/=(const Complex& c) Complex& operator/=(double c) ComplexDouble& operator/=(const ComplexCouble& c) ComplexDouble& operator/=(double c)

124 124 3 Complex operator+(const Complex& rhs) const Complex operator-(const Complex& rhs) const ComplexDouble operator+(const ComplexCouble& rhs) const ComplexDouble operator-(const ComplexCouble& rhs) const 2 Complex operator*(const Complex& rhs) const Complex operator*(double rhs) const ComplexDouble operator*(const ComplexCouble& rhs) const ComplexDouble operator*(double rhs) const 2 Complex operator/(const Complex& rhs) const Complex operator/(double rhs) const ComplexDouble operator/(const ComplexCouble& rhs) const ComplexDouble operator/(double rhs) const 2 Complex operator-(void) const ComplexDouble operator-(void) const bool operator==(const Complex& rhs) const bool operator==(const ComplexCouble& rhs) const

125 3.4 Complex/ComplexDouble Complex/ComplexDouble double abs(complexdouble c) c = a + ib a 2 + b 2 Phase arg(complexdouble c) Phase c = a + ib Arg(c) = tan 1 b/a double norm(complexdouble c) 2 c = a + ib 2 a 2 + b 2 ComplexDouble euler(double t) ComplexDouble Eular t exp(it) = cos t + i sin t ComplexDouble exp(complexdouble c) ComplexDouble c = a + ib exp(c) = exp(a)(cos b + i sin b) ComplexDouble polar(double A, double t) ComplexDouble A t A exp(it) = A(cos t + i sin t) Complex Comp(float r = 0.0, float i = 0.0) Complex

126 126 3 Complex 3.5 Phase 2π φ double Phase π φ < +π wrap Phase(void) Phase(double phase) Phase(float phase) Phase( Phase phase) double float 3 (wrap) Phase operator double() const double double Example Phase ph = ; // d o u b l e P h a s e double pd = ( double ) ph;// P h a s e d o u b l e Phase operator+(phase p) Phase operator-(phase p) Phase Phase wrap Phase wrap wrap

127 3.6 Vector/Point 127 Phase(double phase) Phase(float phase) 1 double 2 float operator double() const double double Example Phase p = ( _Phase ) PI /2; // d o u b l e P h a s e w r a p 3.6 Vector/Point 3 WFL Point Vector Vector /Point 2 2 SetPositionTolerance() GetPositionTolerance() Vector /Point (Rel ) 1 (Rel ) Vector(double x = 0, double y = 0, double z = 0) Point(double x = 0, double y = 0, double z = 0) (x, y, z) (x, y, z)

128 128 3 double GetX() const double GetY() const double GetZ() const x y z void SetX(double val) void SetY(double val) void SetZ(double val) x y z double& X() double& Y() double& Z() x y z static Vector I(void) static Vector J(void) static Vector K(void) x y z Example Vector v; v = Vector ::I ()*3 + Vector ::J ()*2 + Vector ::K ()*4; // v =(3,2,4) double GetLength(void) const

129 3.6 Vector/Point 129 Vector& SetLength(double len) len double GetSqure(void) const 2 2 Vector& Normalize(void) Vector GetNormalized(void) const double GetDistance(Point p) const double GetDistance(const Line& line)const double GetDistance(const Plane& plane)const p Line line Plane plane bool IsInline(const Line& line) const Line line line GetPositionTolerance() SetPositionTolerance()

130 130 3 bool IsInplane(const Plane& plane) const Plane plane plane GetPositionTolerance() SetPositionTolerance() bool IsEmpty() Vector operator-(void) const Vector operator*(double rhs) const Vector operator/(double rhs) const rhs 2 Vector& operator*=(double rhs) Vector& operator/=(double rhs) rhs

131 3.6 Vector/Point 131 Vector operator-(const Vector& rhs) const Vector operator+(const Vector& rhs) const rhs 2 Vector& operator-=(const Vector& rhs) Vector& operator+=(const Vector& rhs) rhs double operator*(const Vector& vec) ( ) vec 2 Vector operator&(const Vector& vec) const ( ) vec 2 Vector& operator&=(const Vector& vec) vec Vector& operator*=(const RMatrix& mat) 3 3 mat v *= M; v Mv RMatrix

132 132 3 Example Vector vec (1, 0, 0), vv; RMatrix mat = RMatrixX (30* Deg ); vec *= mat ; // V e c t o r vv = mat * vec ; // R M a t r i x bool operator==(const Vector& rhs) const bool operator!=(const Vector& rhs) const rhs true 2 () GetPositionTolerance() wfl::setpositiontolerance() 3.7 PointArray Point 3 3 STL vector<point> PointArray(int n = 0) PointArray(const Point& p) PointArray(const LineSegment& ls) 1 n Point 2 Point p 1 3 LineSegment 2 int GetN(void) const

133 3.7 PointArray 133 const Point& GetPoint(int i) const Point i i GetN() Point& At(int i) const Point i i GetN() Example PointArray pa( pp ); pa.at (0) *= 3.0; // 3 void SetPoint(int i, const Point& p) i Point p i GetN() ( ) Insert() void Insert(const Point& p) void Insert(int i, const Point& p) 1 Point p 2 i p

134 134 3 i GetN() ( ) void Remove(void) void Remove(int i) 1 2 i i GetN() ( ) void Clear(void) 0 PointArray& Rotate(const RMatrix& r) RMatrix r PointArray GetBoundingBox(void) const 2 PointArray PointArray x, y, z Example // P o i n t A r r a y p a 1 PointArray pa2 = pa1. GetBoundingBox (); cout << " :" << pa2 [0] << endl ; cout << " :" << pa2 [1] << endl ; cout << ":" << ( pa2 [0] + pa2 [1])/2.0 << endl ;

135 3.7 PointArray 135 Vector GetCenter(void) const Vector void SetCenter(const Vector& p) Vector p void Localize(void) double GetMaxX(void) const double GetMaxY(void) const double GetMaxZ(void) const GetBoundingBox() double GetMinX(void) const double GetMinY(void) const double GetMinZ(void) const GetBoundingBox()

136 136 3 double GetWidth(void) const double GetHeight(void) const double GetDepth(void) const x y z 0 Plane GetPlane(void) const Plane 3 PointArray& ProjectionOn(const Plane& plane) PointArray& ProjectionOn(const Plane& plane, const Line& line) 1 Plane plane 2 Line line Plane plane bool IsInplane(void) const void SaveAsCsv(const char* fname) const fname CSV Point& operator[](int i) const Point i

137 3.8 LineSegment 137 PointArray& operator=(const PointArray& rhs) rhs PointArray& operator-=(const Vector& rhs) PointArray& operator+=(const Vector& rhs) Vector rhs PointArray& operator*=(double m) PointArray& operator*=(const RMatrix& mat) Point 1 m 2 RMatrix mat bool operator==(const PointArray& rhs) rhs true bool operator!=(const PointArray& rhs) rhs true 3.8 LineSegment PointArray PointArray Line 3.8.1

138 138 3 LineSegment() LineSegment(const Point& begin, const Point& end) 1 2 Point begin end const Point& GetBegin(void) const const Point& GetEnd(void) const Point double GetLength(void) const Vector GetVector(void)const Vector Vector GetUnitVector(void) const Vector PointArray& Rotate(const RMatrix& r) PointArray RMatrix r bool IsParallel(const Plane& plane) const true Plane plane

139 3.8 LineSegment 139 bool Intersect(const Plane& plane) const true Plane plane bool IsEmpty(void) const true bool operator==(const LineSegment& ls) ls bool operator!=(const LineSegment& ls) ls PointArray& operator=(const PointArray& rhs) PointArray& operator-=(const Vector& rhs) PointArray& operator+=(const Vector& rhs) PointArray& operator*=(double m) PointArray& operator*=(const RMatrix& mat) PointArray

140 Line LineSegment PointArray LineSegment LineSegment Line(void) Line(const Point& p, const Vector& n) Line(const LineSegment& ls) 1 (0, 0, z) 2 Point p Vector n 3 LineSegment ls const Point& GetPoint(void) const Point const Vector GetUnitVector(void) const LineSegment GetUnitVector() Vector p n t r = tn + p r double GetDistance(const Point& p) const Point p

141 3.9 Line 141 const Point& GetVerticalPoint(const Point& p) const Point p Point Point GetIntersectionPoint(const Plane& plane) const Plane plane Point bool IsParallel(Plane& plane) const Plane plane true bool Include(const Point& p) const Point p p true PointArray& Rotate(const RMatrix& r) PointArray RMatrix r bool IsEmpty(void) const LineSegment IsEmpty()

142 bool operator==(const Vector& rhs) const rhs rhs p true bool operator!=(const Vector& rhs) const rhs PointArray& operator=(const PointArray& rhs) PointArray& operator-=(const Vector& rhs) PointArray& operator+=(const Vector& rhs) PointArray& operator*=(double m) PointArray& operator*=(const RMatrix& mat) PointArray static Line X(void) static Line Y(void) static Line Z(void) Line x y z 3.10 Plane PointArray PointArray

143 3.10 Plane 143 WFL3 GetNormalVector() Plane(void) Plane(const Point& p1, const Point& p2, const Point& p3) Plane(const Point& p, const Vector& n) 1 (x, y, 0) 2 Point 3 p1, p2, p3 3 Vector n 1 p 1 3 () p1, p2, p3 2 n const Vector& GetNormalVector(void) const Vector WFL3 PointArray operator*=() Reverse() WFL3 n n r = n x x + n y y + n z z = d (3.9) d 0 n d GetDistance() void SetNormalVector(const Vector& n) Vector n

144 144 3 void Reverse(void) int GetSide(const Point& p) const p -1: 0:1: p double GetDistance(void) const double GetDistance(const Point& p) const 1 (3.9) d 2 Point p double GetX(double y, double z) const double GetY(double x, double z) const double GetZ(double x, double y) const Point GetIntersectionPoint(const Line& line) const Point Line line Line GetIntersectionLine(const Plane& plane) const Line Plane plane

145 3.10 Plane 145 Point GetVerticalPoint(const Point& p) const Point Point p PointArray& Rotate(const RMatrix& r) PointArray RMatrix r bool IsParallel(const Line& line) const bool IsParallel(const Plane& plane) const Line line Plane plane Include(const Point& p) const Include(const Plane& plane) const Point p Plane plane true Plane true == bool IsEmpty(void) const true

146 146 3 bool operator==(const Plane& plane) const plane true WFL2 true WFL3 true Include() bool operator!=(const Plane& plane) const plane PointArray& operator=(const PointArray& rhs) PointArray& operator-=(const Vector& rhs) PointArray& operator+=(const Vector& rhs) PointArray& operator*=(double m) PointArray& operator*=(const RMatrix& mat) PointArray += -= *= static Plane XY(void) static Plane YZ(void) static Plane ZX(void) Plane (x, y, 0), (0, y, z) (x, 0, z) 3.11 SFrequency Vector (u, v, w) u 2 + v 2 + w 2 = λ 2 (3.10)

147 3.11 SFrequency 147 u, v, w Vector Vector w u v w Normalize() SFrequency() SFrequency(double lmd, double u, double v) 1 2 lmd x u, y v z w u w (3.10) double GetWavelength(void) const void SetWavelength(double val) val SFrequency& SetU(double val) SFrequency& SetV(double val) val x y z w (3.10) SFrequency& SetUV(double u, double v) u x v y z w (3.10)

148 148 3 double GetU(void) const double GetV(void) const [m 1 ] x y double GetW(void) const [m 1 ] z SetU(), SetV(), SetUV() w Normalize() double CalcW(void) const [m 1 ] z w void Normalize(void) z w SFrequency& Rotate(const RMatrix& r) Vector RMatrix r SFrequency operator-(const SFrequency& rhs) SFrequency operator+(const SFrequency& rhs) SFrequency w (z ) (3.10)

149 3.12 RMatrix RMatrix SqrMatrix RMatrix(void) RMatrix(const Vector& dest, const Vector& source) (Rodrigues rotation formula) Vector source Vector dest RMatrix GetInverse(void) RMatrix Vector operator*(const Vector& p) const Vector Vector p RMatrix operator*(const RMatrix& rhs) const RMatix RMatrix rhs SFrequency operator*(const SFrequency& sf) const SFrequency SFrequency sf

150 150 3 SFrequency Normalize() w static const RMatrix& RotationX(double t) static const RMatrix& RotationY(double t) static const RMatrix& RotationZ(double t) RMatrix 3 3 x y z t[rad] RMatrixX() static const RMatrix& CRotationX(double t) static const RMatrix& CRotationY(double t) static const RMatrix& CRotationZ(double t) RMatrix 3 3 x y z t[rad] CRMatrixX() 3.13 StopWatch StopWatch StopWatch(void)

151 3.13 StopWatch 151 void Reset(void) void Start(void) void Stop(void) double LapTime(void) ( ) LapTime() double Read(void) Example StopWatch StopWatch a, b; WaveField wfa (256, 256), wfb (1024, 1024); int i; for (i = 0; i < 10000; i ++) { b. Start (); // b wfb. Fft ( -1); // w f b b. Stop (); // b a. Start (); // a // ********** w f a ************ // a. Stop (); // a b. Start (); // b

152 152 3 } wfb. Fft (1); // w f b b. Stop (); // b a. Start (); // a // ********** w f a ************ // a. Stop (); // a Printf (" w f b :%f\n", b. Read ()); Printf (" w f a :%f\n", a. Read ()); FftLib WaveField FFT MKL Intel Math Kernel Library FFT OOURA Split-Radix FFT FFT ComplexForm WaveField COMPLEX (c = a + bi) SPECTRUM m (x, y) m 1 (u, v) POLAR (c = A exp(iθ)) POLAR SPECTRUM WindowFunc NONE RECTANGLE BARTLETT HAMMING HANNING

153 Mode WaveField INTENSITY REAL IMAGINARY PHASE AMPLITUDE WaveField SaveAsBmp() ColorMode GRAY SCALE RED GREEN BLUE WaveField SaveAsBmp() Interpol LINEAR CUBIC Cubic CUBIC4 4 Cubic CUBIC6 6 Cubic CUBIC8 8 Cubic SINC sinc ADJACENT BILINEAR BICUBIC NEAREST NEIGHBOR (=ADJACENT)

154 154 3 Axis X AXIS x x Y AXIS y y WaveField SaveAsCsv() ErrorCode WaveFieldLib WFL NO ERROR MEMORY FILEOPEN PARAMETER ( ) FILEWRITE FILEREAD SOMETHINGWRONG COMPLEX FORM ComplexForm / INVALID TYPE ComplexForm / INTERNAL ErrorHandling CONSOLE ( ) EXCEPTION Gradation WaveField GRAY COLOR WaveField SaveAsBmp()

155 Platform WIN32 32bit Edition Windows X64 64bit Edtion Windows CLR Windows Common Language Runtime CLI Windows Common Language Infrastructure LINUX32 32bit Linux CpuType CPU 1 SSE1 Streaming SIMD Extension 1 Intel/AMD CPU DevelopEnv ( ) ICC Intel C++ MSC Microsoft C++ GCC GNU gcc 3.15 WaveFieldLib SphericalWaveDescriptor WaveField AddSphericalWaveSqr() SphericalWaveDescriptor(double wavelength, double px, double py, Vector ref=vector(0, 0, 1.0)) SphericalWaveDescriptor wavelength WaveField (px, py) Vector ref ()

156 156 3 bool IsSameAs(double wavelength, double px, double py, Vector ref=vector(0, 0, 1.0)) true bool operator==(const SphericalWaveDescriptor& swd) swd ShiftedFresnelPropDescriptor WaveField ShiftedFresnelProp() ShiftedFresnelPropDescriptor(double distance, double dpx, double dpy, double spx, double spy, double wavelength, int nx, int ny) ShiftedFresnelPropDescriptor(double distance, double destpx, double destpy, const WaveField& source) ShiftedFresnelPropDescriptor 1 distance dpx, dpy spx spy wavelength nx ny 2 source

157 bool IsCompatibleWith(double distance, double dpx, double dpy, double spx, double spy, double wavelength, int nx, int ny) const bool IsCompatibleWith(double distance, double dpx, double dpy, const WaveField& source) const true bool operator==(const ShiftedFresnelPropDescriptor& sfpd) const true

158

159 II PolygonSource (PSL)

160

161 PolygonSource PolygonSource WaveFieldLib PolygonSource 1.0 Beta2 PolygonSource < >=c:\wavefieldtools < >\include\ < >\include\psl\ *.h PolygonSource < >\lib\win32\ 32 < >\lib\ 64 psl.lib

162 162 4 PolygonSource PATH (.exe ) < >\bin\win32\ 32 < >\bin\ 64 psl.dll < >\SampleData\ Diffuser1024x1024.wf < >\SampleCode\ :*.cpp

163 PolygonSource PolygonSource [9, 10] ( ) *1 Example (: ExTrianglePolygon.cpp) 1 # include <psl.h> 2 using namespace wfl ; 3 using namespace psl ; 4 5 int main ( void ) 6 { 7 Start (); 8 9 // x- z 10 psl :: Polygon triangle (3); 11 triangle [1]. SetX (0.5); 12 triangle [1]. SetZ (- sqrt (3.0) / 2.0); 13 triangle [2] = triangle [1]; 14 triangle [2]. SetX ( -0.5); // 17 triangle. Localize (); // 18 triangle *= 2e -3; //1 : m 19 triangle *= RMatrixY (15 * Deg )* RMatrixX (30 * Deg ); // // 22 double px = 4e -6, py = 4e -6; // 23 int nx = 1024, ny = 1024; // 24 WaveField frame (nx, ny, px, py ); //(x,y,0) 25 frame. Clear (); // 28 // WaveField diffuser (0); // 29 // diffuser. LoadWf (" diffuser1024x1024.wf "); // 30 Vector light ( -1.0, -1.0, -1.0); // 31 double env = 0.3; // 32 double gam = 0.5; // 33 TfbFlatShading flatshader (/* diffuser,*/ gam, light, env ); // // S u r f a c e B u i l d e r 36 SurfaceBuilder sb( frame ); 37 sb. SetShader ( flatshader ); // // 40 sb. SetCurrentPolygon ( triangle ); 41 sb. AddPolygonField ( frame ); frame. SaveAsWf (" frame. wf"); 44 } *1 2010/04/22 SurfaceBuilder

164 164 5 psl.h PolygonSource psl.h PolygonSource PolygonSourceLib psl psl Polygon psl Polygon 10 psl::polygon triangle(3) PolygonSource WaveField (WFL) WFL wfl::start() psl.lib psl.h psl.lib PATH (*.EXE) psl.dll Polygon 3 (x, y, z) = (0, 0, 0) triangle[0] (x, 0, z) 2 x z 1[m] PointArray Localize() 18 2[mm] 19 RMatrix x 30 y WaveField ( z ) (x, y, 0) 17 Localize()

165 5.1 PolygonSource ()33 33 / SurfaceBuilder SurfaceBuilder (6.4 ) (6.3.3 ) SurfaceBuilder sb 35 frame SetCurrentPolygon() AddPolygonField() PolygonSource CG Example (: ExCgModel.cpp) 1 # include <psl.h> 2 using namespace wfl ; 3 using namespace psl ; 4 5 int main ( void ) 6 { 7 Start (); wfl :: SetNumThreads (); // 8 9 // 10 IndexedFaceSet model ; 11 model. LoadWrl (" cube. wrl "); // 12 model. Localize (); // 13 model. SetWidth (2e -3); // 2 m m // 16 double px = 4e -6, py = 4e -6; // 17 int nx = 1024, ny = 1024; // 18 WaveField frame (nx, ny, px, py ); //(x,y,0) 19 frame. Clear (); // 22 // WaveField diffuser (0); // 23 // diffuser. LoadWf (" diffuser1024x1024.wf "); // 24 Vector light ( -1.0, -3.0, -1.0); // 25 double env = 0.1; // 26 double gamma = 0.3; // 27 TfbFlatShading flatshader (/* diffuser, */ gamma, light, env ); // // S u r f a c e B u i l d e r 30 SurfaceBuilder sb( frame ); 31 sb. SetDiffractionRatio (0.9); // 32 sb. SetCullingRate (0.6); // 33 sb. SetShader ( flatshader ); // // m o d e l 36 sb. AddObjectField ( frame, model ); // 39 frame. ExactAsmProp (50e -3); frame. SaveAsWf (" frame. wf"); 42 } 7 wfl::setnumthreads()

166 IndexedFaceSet 11 IndexedFaceSet LoadWrl() VRLM2.0 IndexedFaceSet PointArray PointArray Localize() (Bounding Box) IndexedFaceSet SetWidth() 2mm SurfaceBuilder SetDiffractionRate() SetCullingRate() SurfaceBuilder AddObjectField() AddObjectField() SurfaceBuilder SetCallback() SurfaceBuilder 1 sb.setcallback(null); 39 WaveField ExactAsmProp() ExactAsmProp() AsmProp() z 5.1 Example (: OrthoTexureMapping.cpp) 1 # include <psl.h> 2 using namespace wfl ; 3 using namespace psl ; 4 5 int main ( void ) 6 { 7 Start (); wfl :: SetNumThreads (); // 8 9 // 10 double objectsize = 2.5e -3; // 2.5 m m 11 Point posobject (0.5e -3, -0.3e -3, 0); // //

167 y x 3 次元物体 z テクスチャ画像 IndexedFaceSet model ; 15 model. LoadDxf (" Sphere200. dxf "); // 16 model. Localize (); // 17 model. SetWidth ( objectsize ); // 18 model += posobject ; // 19 model. AutoNormalVector (); // // 22 double px = 4e -6, py = 4e -6; // 23 int nx = 1024, ny = 1024; // 24 WaveField frame (nx, ny, px, py ); //(x,y,0) 25 frame. Clear (); // 28 // WaveField diffuser (0); // 29 // diffuser. LoadWf (" diffuser1024x1024.wf ");// 30 Vector light ( -1.0, -1.0, -0.3); // 31 double env = 0.1; // 32 double gamma = 0.01; // 33 TfbGouraudShading gouraudshader (/* diffuser, */ gamma, light, env ); // // 36 Texture teximage ; // 37 teximage. LoadBmp (" MoonTexture. bmp ", INTENSITY, 0, 2.2); // teximage. SetWidth ( objectsize ); // 39 teximage. SetHeight ( objectsize ); // 40 teximage. SetCenter ( posobject ); // 41 TfbOlthoProjectMapping moontexture ( teximage ); // // S u r f a c e B u i l d e r 44 SurfaceBuilder sb( frame ); 45 sb. SetDiffractionRatio (0.9); // 46 sb. SetCullingRate (0.6); // 47 sb. SetShader ( gouraudshader ); // 48 sb. SetTexture ( moontexture ); // // m o d e l 51 sb. AddObjectField ( frame, model ); // 52 frame. SaveAsWf (" object.wf"); // // 55 frame. ExactAsmProp (50e -3); frame. SaveAsWf (" frame.wf"); // 58 } TfbGouraudShading

168 168 5 IndexedFaceSet AutoNormalVector() TfbGouraudShading Texture 2.2 INTENSITY Texture SetWidth() SetHeight() 41 z z TfbOlthoProjectMapping 49 SurfaceBuilder SetTexture() SurfaceBuilder AddObjectField() UV CG UV UV PSL MQO UV Rel 1.1 Rel 1.1 UV Rel 1.0 (by ) UV 5.3 UV Rel 1.1

169 u y z x v テクスチャ画像 3 次元物体 5.3 UV Example UV (Rel 1.1 ) (: ExUvTextureMapping2.cpp) 1 # include <psl.h> 2 using namespace wfl ; 3 using namespace psl ; 4 5 void main ( void ) 6 { 7 Start (); wfl :: SetNumThreads (); // 8 9 // 10 double objectsize = 6e -3; // 6 m m 11 Point posobject (0, 0, -50e -3); // // 14 IndexedFaceSet model ; 15 model. LoadMqo (" bus. mqo "); // U V 16 model. Localize (); // 17 model. SetWidth ( objectsize ); // 18 model += posobject ; // 19 model. AutoNormalVector (); // // 22 double px = 10e -6, py = 10e -6; // 23 int nx = 1024, ny = 1024; // 24 WaveField frame (nx, ny, px, py ); 25 frame. SetOrigin ( posobject ); // 26 frame. Clear (); // 29 // WaveField diffuser (0); // 30 // diffuser. LoadWf (" diffuser1024x1024.wf ");// 31 Vector light ( -1.0, -1.0, -0.3); // 32 double env = 0.1; // 33 double gamma = 0.01; // 34 TfbGouraudShading gouraudshader (/* diffuser,*/ gamma, light, env ); // // U V 37 std :: vector < char *> texnames ; // 38 GetTextureNamesMqo (" bus. mqo ", texnames ); // 39 TfbUvMapping bustexture ( texnames, ".\\ ", 2.2, wfl :: GRAY_SCALE ); // U V 40 // 41 // S u r f a c e B u i l d e r 42 SurfaceBuilder sb( frame ); 43 sb. SetDiffractionRatio (0.9); // 44 sb. SetCullingRate (0.6); // 45 sb. SetShader ( gouraudshader ); // 46 sb. SetTexture ( bustexture ); // U V // m o d e l 49 sb. AddObjectField ( frame, model ); // 50 frame. SaveAsWf (" object.wf"); // // (z =0) 53 frame. ExactAsmProp (- posobject. GetZ ()); frame. SaveAsWf (" frame.wf"); // 56 }

170 UV IndexedFaceSet LoadMqo() IndexedFaceSet model 5.4 UV MQO GetTextureNamesMqo() texnames 40 TfbUvMapping bustexture TfbUvMapping 4 bus.mqo 2.2 (ColorMode ) 47 SurfaceBuilder sb bustexture 50 AddObjectField() UV 400 pixel 500 pixel 5.4 UV 5.3 ( ) D [11] Example (: ExSimpleSilhouette.cpp) 1 # include " psl.h" 2 using namespace wfl ; 3 using namespace psl ; 4 5 int main ( void ) 6 { 7 Start (); wfl :: SetNumThreads (); // 8 9 // 10 Point poswallpaper (0, 0, -100e -3); //z = -100 m m 11 Point posobject (0, 0, -50e -3); //z= -50 m m // 14 double px = 4e -6, py = 4e -6; // 15 int nx = 1024, ny = 1024; // 16 WaveField frame (nx, ny, px, py ); //(x,y,0) 17 frame. Clear (); 18 frame. SetOrigin ( poswallpaper ); //

171 5.3 ( ) // ( ) 21 double width = 4e -3, height = 4e -3; // 22 WaveField wallpaper ; 23 wallpaper. LoadBmp (" Checker (256 x256 ). bmp ", AMPLITUDE ); // 24 wallpaper. SetPx ( width / wallpaper. GetNx ()); // 25 wallpaper. SetPy ( height / wallpaper. GetNy ()); // 26 wallpaper. SetOrigin ( poswallpaper ); // // 29 WaveField wpframe = frame ; // 30 wpframe. Clear (); 31 wpframe. ResamplingAdd ( wallpaper, NEAREST_NEIGHBOR ); // // // WaveField diffuser ; // 35 // diffuser. LoadWf (" diffuser1024x1024.wf ");// 36 // MultiplyDiffuser ( wpframe, diffuser ); // wpframe. ModRandomPhase (); // 39 frame += wpframe ; // ( ) 40 wpframe. Dispose (); // 41 frame. SaveAsWf (" frame0.wf"); // 42 frame. ExactAsmProp ( posobject. GetZ () - poswallpaper. GetZ ()); 43 //. z= -50 m m // 46 IndexedFaceSet model ; 47 model. LoadWrl (" cube. wrl "); // 48 model. Localize (); // 49 model. SetWidth (2e -3); // 2 m m 50 model += posobject ; // // 53 PaintObjectSilhouette ( frame, model ); //(0) 54 frame. SaveAsWf (" frame1.wf"); // // 57 Vector light ( -1.0, -2.0, -1.0); // 58 double env = 0.2; // 59 double gamma = 0.3; // 60 TfbFlatShading flatshader (/* diffuser, */ gamma, light, env ); // // S u r f a c e B u i l d e r 63 SurfaceBuilder sb( frame ); 64 sb. SetDiffractionRatio (1.0); // 65 sb. SetCullingRate (0.6); // 66 sb. SetShader ( flatshader ); // // m o d e l 69 sb. AddObjectField ( frame, model ); 70 frame. SaveAsWf (" frame2.wf"); // // 73 frame. ExactAsmProp (0 - posobject. GetZ ()); frame. SaveAsWf (" frame.wf"); // 76 } 10 2 z = 100mm 3 z = 50mm 3D 3D 18 z = 100mm 22 Texture INTENSITY wpframe 31 ResamplingCopy() MultiplyDiffuser()

172 172 5 = > 5.5 (frame0.wf) ModRandomPhase() (z = 50mm) z = 50mm 53 PaintObjectSilhouette() 5.6 (a) = > 5.6 (frame1.wf) (frame2.wf) (b)

173 5.3 ( ) 173 Example 1 # include <psl.h> 2 using namespace wfl ; 3 using namespace psl ; 4 (: ExSwitchBack1.cpp) 5 void main ( void ) 6 { 7 Start (); wfl :: SetNumThreads (); // 8 9 // 10 double objectsize = 4e -3; // 4 m m 11 Point posobject (0, 0, -20e -3); // // 14 IndexedFaceSet model ; 15 model. LoadMqo (" miku1 \\ miltukumiku. mqo "); // U V 16 model. Localize (); // 17 model. SetHeight ( objectsize ); // ( ) 18 model += posobject ; // 19 model. AutoNormalVector (); // 20 model. SortByDepth (); // // 23 double px = 1e -6, py = 1e -6; // 24 int nx = 4096, ny = 4096; // 25 WaveField frame (nx, ny, px, py ); 26 frame. SetOrigin ( posobject ); // 27 frame. Clear (); // 30 // WaveField diffuser (0); // 31 // diffuser. LoadWf (" diffuser1024x1024.wf ");// 32 Vector light ( -1.0, -1.0, -0.3); // 33 double env = 0.1; // 34 double gamma = 0.01; // 35 TfbGouraudShading gouraudshader (/* diffuser, */ gamma, light, env ); 36 // // U V 39 std :: vector < char *> texnames ; // 40 GetTextureNamesMqo (" miku1 \\ miltukumiku. mqo ", texnames ); // 41 TfbUvMapping texture ( texnames, ".\\ miku1 \\", 2.2, wfl :: GRAY_SCALE ); // U V 42 //" miku1 " 43 // S u r f a c e B u i l d e r 44 SurfaceBuilder sb( frame ); 45 sb. SetDiffractionRatio (0.9); // 46 sb. SetCullingRate (0.6); // 47 sb. SetShader ( gouraudshader ); // 48 sb. SetTexture ( texture ); // U V // m o d e l 51 sb. AddObjectFieldSb ( frame, model ); // 52 frame. SaveAsWf (" object.wf"); // // (z =0) 55 frame. ExactAsmProp (- posobject. GetZ ()); frame. SaveAsWf (" frame.wf"); // 58 } 3D psl BMP 8 BMP miku1 MQO AddObjectField() AddObjectFieldSb()

174 IndexedFaceSet SortByDepth() 41 TfbUvMapping texture \\ 2.2 (ColorMode ) Object.wf Object.wf 5.4 [10] SegWaveField SegWaveField (Segemented wave-field) SegWaveField [10] Example (: ExSegmentation.cpp) 1 # include " psl.h" 2 using namespace wfl ; 3 using namespace psl ; 4 5 int main () 6 { 7 Start (); 8 SegWaveField sw (4, 3, 256, 256); 9 sw. SetWavelength (532e -9); // 10 sw. SetPx (4e -6); // 11 sw. SetPy (4e -6); 12 sw. SyncParam () ; // 13 sw. SetCenter ( Point (1e -3, 0, 0)); // int i, j; 16 for (j = 0; j < sw. GetMy (); j ++) // 17 { 18 for (i = 0; i < sw. GetMx (); i++) 19 { 20 // (i,j) ( ) 21 sw. Segment (i, j); // ( W a v e F i e l d ) 24 sw. AddSphericalWave ( Point (0, 0, -50e -3)); //

2 WaveField Rel PolygonSource Rel Rel WaveField ( wfl) PolygonSource ( psl) / wfl/psl wfl/psl

2 WaveField Rel PolygonSource Rel Rel WaveField ( wfl) PolygonSource ( psl) / wfl/psl wfl/psl WaveFieldTools 2010 11 5 2 WaveField Rel 2.81.0 PolygonSource Rel 0.85.0 Rel 1.8.0 WaveField ( wfl) PolygonSource ( psl) / wfl/psl wfl/psl http://www.laser.ee.kansai-u.ac.jp/wavefieldtools Acrobat Reader

More information

CudaWaveField

CudaWaveField CudaWaveField 2012 3 22 2 CudaWaveField Rel 1.0.0 Rel 1.0 CudaWaveField ( cwfl) / cwfl cwfl http://www.laser.ee.kansai-u.ac.jp/wavefieldtools Note Acrobat Reader 3 I CudaWaveField 9 1 11 1.1 CudaWaveField......................

More information

GLS user s reference 19 8 21 1 3 1.1....................................................... 3 1.2....................................................... 3 1.3.......................................................

More information

2 1 Web Java Android Java 1.2 6) Java Java 7) 6) Java Java (Swing, JavaFX) (JDBC) 7) OS 1.3 Java Java

2 1 Web Java Android Java 1.2 6) Java Java 7) 6) Java Java (Swing, JavaFX) (JDBC) 7) OS 1.3 Java Java 1 Java Java 1.1 Java 1) 2) 3) Java OS Java 1.3 4) Java Web Start Web / 5) Java C C++ Java JSP(Java Server Pages) 1) OS 2) 3) 4) Java Write Once, Run Anywhere 5) Java Web Java 2 1 Web Java Android Java

More information

# let st1 = {name = "Taro Yamada"; id = };; val st1 : student = {name="taro Yamada"; id=123456} { 1 = 1 ;...; n = n } # let string_of_student {n

# let st1 = {name = Taro Yamada; id = };; val st1 : student = {name=taro Yamada; id=123456} { 1 = 1 ;...; n = n } # let string_of_student {n II 6 / : 2001 11 21 (OCaml ) 1 (field) name id type # type student = {name : string; id : int};; type student = { name : string; id : int; } student {} type = { 1 : 1 ;...; n : n } { 1 = 1 ;...; n = n

More information

FFTSS Library Version 3.0 User's Guide

FFTSS Library Version 3.0 User's Guide : 19 10 31 FFTSS 3.0 Copyright (C) 2002-2007 The Scalable Software Infrastructure Project, (CREST),,. http://www.ssisc.org/ Contents 1 4 2 (DFT) 4 3 4 3.1 UNIX............................................

More information

(STL) STL 1 (deta structure) (algorithm) (deta structure) 2 STL STL (Standard Template Library) 2.1 STL STL ( ) vector<int> x; for(int i = 0; i < 10;

(STL) STL 1 (deta structure) (algorithm) (deta structure) 2 STL STL (Standard Template Library) 2.1 STL STL ( ) vector<int> x; for(int i = 0; i < 10; (STL) STL 1 (deta structure) (algorithm) (deta structure) 2 STL STL (Standard Template Library) 2.1 STL STL ( ) vector x; for(int i = 0; i < 10; ++i) x.push_back(i); vector STL x.push_back(i) STL

More information

1. A0 A B A0 A : A1,...,A5 B : B1,...,B

1. A0 A B A0 A : A1,...,A5 B : B1,...,B 1. A0 A B A0 A : A1,...,A5 B : B1,...,B12 2. 3. 4. 5. A0 A B f : A B 4 (i) f (ii) f (iii) C 2 g, h: C A f g = f h g = h (iv) C 2 g, h: B C g f = h f g = h 4 (1) (i) (iii) (2) (iii) (i) (3) (ii) (iv) (4)

More information

double float

double float 2015 3 13 1 2 2 3 2.1.......................... 3 2.2............................. 3 3 4 3.1............................... 4 3.2 double float......................... 5 3.3 main.......................

More information

K227 Java 2

K227 Java 2 1 K227 Java 2 3 4 5 6 Java 7 class Sample1 { public static void main (String args[]) { System.out.println( Java! ); } } 8 > javac Sample1.java 9 10 > java Sample1 Java 11 12 13 http://java.sun.com/j2se/1.5.0/ja/download.html

More information

cpp4.dvi

cpp4.dvi 2017 c 4 C++ (4) C++, 41, 42, 1, 43,, 44 45, 41 (inheritance),, C++,, 100, 50, PCMCIA,,,,,,,,, 42 1 421 ( ), car 1 [List 41] 1: class car { 2: private: 3: std::string m model; // 4: std::string m maker;

More information

Report Template

Report Template 1 1 1 2 3 3 1 2 4 2 1 2 3 4 5 6 7 2 1 2 3 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 7 8 3 9 10 3 11 12 13 14 4 15 16 17 18 19 2 1 1 1 4

More information

DiMP Users Manual Yuichi Tazaki

DiMP Users Manual Yuichi Tazaki DiMP Users Manual Yuichi Tazaki 3 1 5 2 7 2.1............................. 7 2.2........................... 7 3 DiMP 9 3.1............................... 9 3.2........................... 10 3.3...................................

More information

G (n) (x 1, x 2,..., x n ) = 1 Dφe is φ(x 1 )φ(x 2 ) φ(x n ) (5) N N = Dφe is (6) G (n) (generating functional) 1 Z[J] d 4 x 1 d 4 x n G (n) (x 1, x 2

G (n) (x 1, x 2,..., x n ) = 1 Dφe is φ(x 1 )φ(x 2 ) φ(x n ) (5) N N = Dφe is (6) G (n) (generating functional) 1 Z[J] d 4 x 1 d 4 x n G (n) (x 1, x 2 6 Feynman (Green ) Feynman 6.1 Green generating functional Z[J] φ 4 L = 1 2 µφ µ φ m 2 φ2 λ 4! φ4 (1) ( 1 S[φ] = d 4 x 2 φkφ λ ) 4! φ4 (2) K = ( 2 + m 2 ) (3) n G (n) (x 1, x 2,..., x n ) = φ(x 1 )φ(x

More information

解きながら学ぶJava入門編

解きながら学ぶJava入門編 44 // class Negative { System.out.print(""); int n = stdin.nextint(); if (n < 0) System.out.println(""); -10 Ÿ 35 Ÿ 0 n if statement if ( ) if i f ( ) if n < 0 < true false true false boolean literalboolean

More information

課題

課題 int starttime_msec; boolean counting = false; size(400,200); smooth(); //font は各自のものに変更してください font = loadfont("serif-48.vlw"); void mouseclicked(){ counting = true; starttime_msec = millis(); int t=0;

More information

II 2014 2 (1) log(1 + r/100) n = log 2 n log(1 + r/100) = log 2 n = log 2 log(1 + r/100) (2) y = f(x) = log(1 + x) x = 0 1 f (x) = 1/(1 + x) f (0) = 1

II 2014 2 (1) log(1 + r/100) n = log 2 n log(1 + r/100) = log 2 n = log 2 log(1 + r/100) (2) y = f(x) = log(1 + x) x = 0 1 f (x) = 1/(1 + x) f (0) = 1 II 2014 1 1 I 1.1 72 r 2 72 8 72/8 = 9 9 2 a 0 1 a 1 a 1 = a 0 (1+r/100) 2 a 2 a 2 = a 1 (1 + r/100) = a 0 (1 + r/100) 2 n a n = a 0 (1 + r/100) n a n a 0 2 n a 0 (1 + r/100) n = 2a 0 (1 + r/100) n = 2

More information

programmingII2019-v01

programmingII2019-v01 II 2019 2Q A 6/11 6/18 6/25 7/2 7/9 7/16 7/23 B 6/12 6/19 6/24 7/3 7/10 7/17 7/24 x = 0 dv(t) dt = g Z t2 t 1 dv(t) dt dt = Z t2 t 1 gdt g v(t 2 ) = v(t 1 ) + g(t 2 t 1 ) v v(t) x g(t 2 t 1 ) t 1 t 2

More information

応用数学特論.dvi

応用数学特論.dvi 1 1 1.1.1 ( ). P,Q,R,.... 2+3=5 2 1.1.2 ( ). P T (true) F (false) T F P P T P. T 2 F 1.1.3 ( ). 2 P Q P Q P Q P Q P or Q P Q P Q P Q T T T T F T F T T F F F. P = 5 4 Q = 3 2 P Q = 5 4 3 2 P F Q T P Q T

More information

第7章 レンダリング

第7章 レンダリング 7 April 11, 2017 1 / 59 7.1 ( ) CG 3 ( ) 2 / 59 7.2 7.2.1 ( ) 3 (rendering) 1 / (hidden line/surface calculation) a (outer normal algorithm) b Z (Z-buffer algorithm) c (scan-line algorithm) 2 (shading)

More information

第7章 レンダリング

第7章 レンダリング 7 May 18, 2012 1 / 60 71 ( ) CG 3 ( ) 2 / 60 72 71 ( ) 3 (rendering) 1 / (hidden line/surface calculation) a (outer normal algorithm) b Z (Z-buffer algorithm) c (scan-line algorithm) 2 (shading) a (flat

More information

‚æ4›ñ

‚æ4›ñ ( ) ( ) ( ) A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 (OUS) 9 26 1 / 28 ( ) ( ) ( ) A B C D Z a b c d z 0 1 2 9 (OUS) 9

More information

I J

I J I 065763J 8 7 7 31 jikken/ +----- accumulation_demupa.c +----- accumulation_rain.c +----- frequency_demupa.c +----- frequency_rain.c +----- go.sh +----- graph_maker.sh +----- mesure-ryudai/ 2007/4/1 2007/6/30

More information

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) 3 5 14 18 21 23 23 24 28 29 29 31 32 34 35 35 36 38 40 44 44 45 46 49 49 50 pref : 2004/6/5 (11:8) 50 51 52 54 55 56 57 58 59 60 61

More information

ProVisionaire Control V3.0セットアップガイド

ProVisionaire Control V3.0セットアップガイド ProVisionaire Control V3 1 Manual Development Group 2018 Yamaha Corporation JA 2 3 4 5 NOTE 6 7 8 9 q w e r t r t y u y q w u e 10 3. NOTE 1. 2. 11 4. NOTE 5. Tips 12 2. 1. 13 3. 4. Tips 14 5. 1. 2. 3.

More information

2009 2010 2 23 (MHD ) GFV (Galium Field Visualizer) GFV OpenGL GFV GFV GFV 1 1 2 2 2.1.................... 2 2.2................................. 2 2.3...................... 3 3 6 3.1 GFV....................

More information

- - http://168iroha.net 018 10 14 i 1 1 1.1.................................................... 1 1.................................................... 7.1................................................

More information

(300, 150) 120 getchar() HgBox(x, y, w, h) (x, y), w, h #include <stdio.h> #include <handy.h> int main(void) { int i; double w, h; } HgO

(300, 150) 120 getchar() HgBox(x, y, w, h) (x, y), w, h #include <stdio.h> #include <handy.h> int main(void) { int i; double w, h; } HgO Handy Graphic for Handy Graphic Version 0.5 2008-06-09 1 Handy Graphic Handy Graphic C Handy Graphic Handy Graphic Mac OS X Handy Graphic HgDisplayer Handy Graphic HgDisplayer 2 Handy Graphic 1 Handy Graphic

More information

Python Speed Learning

Python   Speed Learning Python Speed Learning 1 / 76 Python 2 1 $ python 1 >>> 1 + 2 2 3 2 / 76 print : 1 print : ( ) 3 / 76 print : 1 print 1 2 print hello 3 print 1+2 4 print 7/3 5 print abs(-5*4) 4 / 76 print : 1 print 1 2

More information

BW BW

BW BW Induced Sorting BW 11T2042B 2015 3 23 1 1 1.1................................ 1 1.2................................... 1 2 BW 1 2.1..................................... 2 2.2 BW.................................

More information

Java学習教材

Java学習教材 Java 2016/4/17 Java 1 Java1 : 280 : (2010/1/29) ISBN-10: 4798120987 ISBN-13: 978-4798120980 2010/1/29 1 Java 1 Java Java Java class FirstExample { public static void main(string[] args) { System.out.println("

More information

untitled

untitled Fortran90 ( ) 17 12 29 1 Fortran90 Fortran90 FORTRAN77 Fortran90 1 Fortran90 module 1.1 Windows Windows UNIX Cygwin (http://www.cygwin.com) C\: Install Cygwin f77 emacs latex ps2eps dvips Fortran90 Intel

More information

Emacs ML let start ::= exp (1) exp ::= (2) fn id exp (3) ::= (4) (5) ::= id (6) const (7) (exp) (8) let val id = exp in

Emacs ML let start ::= exp (1) exp ::= (2) fn id exp (3) ::= (4) (5) ::= id (6) const (7) (exp) (8) let val id = exp in Emacs, {l06050,sasano}@sic.shibaura-it.ac.jp Eclipse Visual Studio Standard ML Haskell Emacs 1 Eclipse Visual Studio variable not found LR(1) let Emacs Emacs Emacs Java Emacs JDEE [3] JDEE Emacs Java 2

More information

2 G(k) e ikx = (ik) n x n n! n=0 (k ) ( ) X n = ( i) n n k n G(k) k=0 F (k) ln G(k) = ln e ikx n κ n F (k) = F (k) (ik) n n= n! κ n κ n = ( i) n n k n

2 G(k) e ikx = (ik) n x n n! n=0 (k ) ( ) X n = ( i) n n k n G(k) k=0 F (k) ln G(k) = ln e ikx n κ n F (k) = F (k) (ik) n n= n! κ n κ n = ( i) n n k n . X {x, x 2, x 3,... x n } X X {, 2, 3, 4, 5, 6} X x i P i. 0 P i 2. n P i = 3. P (i ω) = i ω P i P 3 {x, x 2, x 3,... x n } ω P i = 6 X f(x) f(x) X n n f(x i )P i n x n i P i X n 2 G(k) e ikx = (ik) n

More information

解きながら学ぶC++入門編

解きながら学ぶC++入門編 第 1 章 画面 出力 入力 2 問題 1-1 C++ List 1-1p.4 C++ // cout

More information

10-C.._241_266_.Z

10-C.._241_266_.Z Windows 10 1 2 3 4 5 Visual Studio 2008LINQ MySchedule 242 Microsoft Visual C# 2008 10 Windows 243 1 LINQIEnumerableXML LINQ to Object q Form1.cs w RefreshListBox private void RefreshListBox() schedulelistbox.items.clear();

More information

2.2 Java C main Java main 2 C 6 C Java 3 C Java ( ) G101Hello.java G101Hello main G101Hello.java /* G101Hello */ class G101Hello { /* main */ public s

2.2 Java C main Java main 2 C 6 C Java 3 C Java ( ) G101Hello.java G101Hello main G101Hello.java /* G101Hello */ class G101Hello { /* main */ public s 2 2013 4 16 2.1............................... 2 1 2.2 Java......................... 2 2 2.3............. 2 2 2.4................................ 2 4 2.5............................ 2 5 2.6............................

More information

Java演習(4) -- 変数と型 --

Java演習(4)   -- 変数と型 -- 50 20 20 5 (20, 20) O 50 100 150 200 250 300 350 x (reserved 50 100 y 50 20 20 5 (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; (reserved public class Blocks1 extends

More information

24.15章.微分方程式

24.15章.微分方程式 m d y dt = F m d y = mg dt V y = dy dt d y dt = d dy dt dt = dv y dt dv y dt = g dv y dt = g dt dt dv y = g dt V y ( t) = gt + C V y ( ) = V y ( ) = C = V y t ( ) = gt V y ( t) = dy dt = gt dy = g t dt

More information

1

1 PalmGauss SC PGSC-5G Instruction Manual PalmGauss SC PGSC-5G Version 1.01 PalmGauss SC PGSC5G 1.... 3 2.... 3 3.... 3 3.1... 3 3.2... 3 3.3 PalmGauss... 4 3.4... 4 3.4.1 (Fig. 4)... 4 3.4.2 (Fig. 5)...

More information

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225 Java Java Java Java Java 4 p35 4-2 * *** ***** *** * Unix p36 4-3 a,b,c,d 100,200,250,500 a*b = 20000 a*b+c = 20250 a*b+c*d = 145000 (a+b)*(c+d) = 225000 a+b*c+d = 50600 b/a+d/c = 4 p38 4-4 (1) mul = 1

More information

第3章 OpenGL の基礎

第3章 OpenGL の基礎 3 OpenGL April 11, 2017 1 / 28 3.1 ( ) OpenGL OpenGL 2 / 28 3.2 OpenGL OpenGL OpenGL (Open Graphics Library) Silicon Graphics, Inc. 2 3 API (Application Program Interface) [4] UNIX OS Windows Macintosh

More information

第3章 OpenGL の基礎

第3章 OpenGL の基礎 3 OpenGL April 20, 2012 1 / 23 31 ( ) OpenGL OpenGL 2 / 23 32 OpenGL OpenGL OpenGL (Open Graphics Library) Silicon Graphics, Inc 2 3 API (Application Program Interface) [4] UNIX OS Windows Macintosh CAD

More information

Q&A集

Q&A集 MapViewer & ver.2 EWEB-3C-N055 PreSerV for Web MapViewer & i 1... 1 1.1... 1 1.2... 2 1.3... 3 1.4... 4 1.5... 5 1.6... 6 1.7... 7 1.8... 8 1.9... 9 1.10...11 1.11...12 1.12...13 1.13...14 1.14...15 1.15...16

More information

cpp1.dvi

cpp1.dvi 2017 c 1 C++ (1) C C++, C++, C 11, 12 13 (1) 14 (2) 11 1 n C++ //, [List 11] 1: #include // C 2: 3: int main(void) { 4: std::cout

More information

[ 1] 1 Hello World!! 1 #include <s t d i o. h> 2 3 int main ( ) { 4 5 p r i n t f ( H e l l o World!! \ n ) ; 6 7 return 0 ; 8 } 1:

[ 1] 1 Hello World!! 1 #include <s t d i o. h> 2 3 int main ( ) { 4 5 p r i n t f ( H e l l o World!! \ n ) ; 6 7 return 0 ; 8 } 1: 005 9 7 1 1.1 1 Hello World!! 5 p r i n t f ( H e l l o World!! \ n ) ; 7 return 0 ; 8 } 1: 1 [ ] Hello World!! from Akita National College of Technology. 1 : 5 p r i n t f ( H e l l o World!! \ n ) ;

More information

新版明解C言語 実践編

新版明解C言語 実践編 2 List - "max.h" a, b max List - max "max.h" #define max(a, b) ((a) > (b)? (a) : (b)) max List -2 List -2 max #include "max.h" int x, y; printf("x"); printf("y"); scanf("%d", &x); scanf("%d", &y); printf("max(x,

More information

For_Beginners_CAPL.indd

For_Beginners_CAPL.indd CAPL Vector Japan Co., Ltd. 目次 1 CAPL 03 2 CAPL 03 3 CAPL 03 4 CAPL 04 4.1 CAPL 4.2 CAPL 4.3 07 5 CAPL 08 5.1 CANoe 5.2 CANalyzer 6 CAPL 10 7 CAPL 11 7.1 CAPL 7.2 CAPL 7.3 CAPL 7.4 CAPL 16 7.5 18 8 CAPL

More information

x, y x 3 y xy 3 x 2 y + xy 2 x 3 + y 3 = x 3 y xy 3 x 2 y + xy 2 x 3 + y 3 = 15 xy (x y) (x + y) xy (x y) (x y) ( x 2 + xy + y 2) = 15 (x y)

x, y x 3 y xy 3 x 2 y + xy 2 x 3 + y 3 = x 3 y xy 3 x 2 y + xy 2 x 3 + y 3 = 15 xy (x y) (x + y) xy (x y) (x y) ( x 2 + xy + y 2) = 15 (x y) x, y x 3 y xy 3 x 2 y + xy 2 x 3 + y 3 = 15 1 1977 x 3 y xy 3 x 2 y + xy 2 x 3 + y 3 = 15 xy (x y) (x + y) xy (x y) (x y) ( x 2 + xy + y 2) = 15 (x y) ( x 2 y + xy 2 x 2 2xy y 2) = 15 (x y) (x + y) (xy

More information

Copyright c 2006 Zhenjiang Hu, All Right Reserved.

Copyright c 2006 Zhenjiang Hu, All Right Reserved. 1 2006 Copyright c 2006 Zhenjiang Hu, All Right Reserved. 2 ( ) 3 (T 1, T 2 ) T 1 T 2 (17.3, 3) :: (Float, Int) (3, 6) :: (Int, Int) (True, (+)) :: (Bool, Int Int Int) 4 (, ) (, ) :: a b (a, b) (,) x y

More information

応力とひずみ.ppt

応力とひずみ.ppt in yukawa@numse.nagoya-u.ac.jp 2 3 4 5 x 2 6 Continuum) 7 8 9 F F 10 F L L F L 1 L F L F L F 11 F L F F L F L L L 1 L 2 12 F L F! A A! S! = F S 13 F L L F F n = F " cos# F t = F " sin# S $ = S cos# S S

More information

ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1

ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1 More Logic More Types ML/OCaml GADT Jacques Garrigue ( ) Jacques Le Normand (Google) Didier Rémy (INRIA) @garriguejej ocamlgadt ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1 ( ) ML type nebou and

More information

JAXA key

JAXA key ! 芸術衛星INVADERのフライトモデル I A 2 8 7 IC J 6 R 22 I 7 6 C 9 I 9 9 J 7R 2 R 9 6 8 I 7 8 7 2 I22 7 8 2 J C I R 2 8 7 J 8 2 R C J C 9 6 I 2 6 7 2 8 8 6 I C 7 I C 9 C 9 J 7 C R 2 8 7 I I 9 6 8 2 R J 8 7 C

More information

3 filename=quantum-3dim110705a.tex ,2 [1],[2],[3] [3] U(x, y, z; t), p x ˆp x = h i x, p y ˆp y = h i y, p z ˆp z = h

3 filename=quantum-3dim110705a.tex ,2 [1],[2],[3] [3] U(x, y, z; t), p x ˆp x = h i x, p y ˆp y = h i y, p z ˆp z = h filename=quantum-dim110705a.tex 1 1. 1, [1],[],[]. 1980 []..1 U(x, y, z; t), p x ˆp x = h i x, p y ˆp y = h i y, p z ˆp z = h i z (.1) Ĥ ( ) Ĥ = h m x + y + + U(x, y, z; t) (.) z (U(x, y, z; t)) (U(x,

More information

GraphicsWithPlotFull.nb Plot[{( 1), ( ),...}, {( ), ( ), ( )}] Plot Plot Cos x Sin x, x, 5 Π, 5 Π, AxesLabel x, y x 1 Plot AxesLabel

GraphicsWithPlotFull.nb Plot[{( 1), ( ),...}, {( ), ( ), ( )}] Plot Plot Cos x Sin x, x, 5 Π, 5 Π, AxesLabel x, y x 1 Plot AxesLabel http://yktlab.cis.k.hosei.ac.jp/wiki/ 1(Plot) f x x x 1 1 x x ( )[( 1)_, ( )_, ( 3)_,...]=( ) Plot Plot f x, x, 5, 3 15 10 5 Plot[( ), {( ), ( ), ( )}] D g x x 3 x 3 Plot f x, g x, x, 10, 8 00 100 10 5

More information

ウィンドウ操作 応用

ウィンドウ操作 応用 Win32API 関数 ウィンドウ操作 ウィンドウ名でトップレベルウィンドウ ( 親を持たないウィンドウ ) のハンドルを取得 メモ帳や電卓等のウィンドウ名でトップレベルウィンドウ ( 親を持たないウィンドウ ) のハンドルを取得する方法を 下記に示す Visual Basic Imports System.Runtime.InteropServices Public Class WindowFromWindowName

More information

C# ++ MASA C# ( ) XNA 1.1 C# ( ) VisualStuio XNA 4.0 VisualStuio XNA 3.1 * * *3 2.1 VisualStuio Windows ( TextGam

C# ++ MASA C# ( ) XNA 1.1 C# ( ) VisualStuio XNA 4.0 VisualStuio XNA 3.1 * * *3 2.1 VisualStuio Windows ( TextGam C# ++ MASA 2011 8 1 C# ( ) XNA 1.1 C# ( ) VisualStuio 2010 + XNA 4.0 VisualStuio 2008 + XNA 3.1 *1 1.2 1 *2 1.3 2 *3 2.1 VisualStuio Windows ( TextGame2 ) OK *1 XNA 3.1 4.0 *2 *3 1 TextGame2 ( Ship ) 32*32

More information

matrix util program bstat gram schmidt

matrix util program bstat gram schmidt matrix util 14 12 3 1 2 2 program 2 2.1 bstat............................... 3 2.2 gram schmidt........................... 3 2.3 matadd............................... 3 2.4 matarith.............................

More information

6kg 1.1m 1.m.1m.1 l λ ϵ λ l + λ l l l dl dl + dλ ϵ dλ dl dl + dλ dl dl 3 1. JIS 1 6kg 1% 66kg 1 13 σ a1 σ m σ a1 σ m σ m σ a1 f f σ a1 σ a1 σ m f 4

6kg 1.1m 1.m.1m.1 l λ ϵ λ l + λ l l l dl dl + dλ ϵ dλ dl dl + dλ dl dl 3 1. JIS 1 6kg 1% 66kg 1 13 σ a1 σ m σ a1 σ m σ m σ a1 f f σ a1 σ a1 σ m f 4 35-8585 7 8 1 I I 1 1.1 6kg 1m P σ σ P 1 l l λ λ l 1.m 1 6kg 1.1m 1.m.1m.1 l λ ϵ λ l + λ l l l dl dl + dλ ϵ dλ dl dl + dλ dl dl 3 1. JIS 1 6kg 1% 66kg 1 13 σ a1 σ m σ a1 σ m σ m σ a1 f f σ a1 σ a1 σ m

More information

Microsoft Word - Sample_CQS-Report_English_backslant.doc

Microsoft Word - Sample_CQS-Report_English_backslant.doc ***** Corporation ANSI C compiler test system System test report 2005/11/16 Japan Novel Corporation *****V43/NQP-DS-501-1 Contents Contents......2 1. Evaluated compiler......3 1.1. smp-compiler compiler...3

More information

MainOfManuscript.dvi

MainOfManuscript.dvi 18 2 28 0244086 IC IC IC (MDA) 20% 60% i 1 1 2 4 2.1................. 4 2.2 UHF............. 9 2.2.1 315MH.......................... 10 2.2.2 433MH.......................... 13 2.2.3.......................

More information

x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x i ) A(x i ) = h 2 {f(x i) + f(x i+1 ) = h {f(a + i h) + f(a + (i + 1) h), (2) 2 a b n A(x i )

x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x i ) A(x i ) = h 2 {f(x i) + f(x i+1 ) = h {f(a + i h) + f(a + (i + 1) h), (2) 2 a b n A(x i ) 1 f(x) a b f(x)dx = n A(x i ) (1) ix [a, b] n i A(x i ) x i 1 f(x) [a, b] n h = (b a)/n y h = (b-a)/n y = f (x) h h a a+h a+2h a+(n-1)h b x 1: 1 x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x

More information

ohp11.dvi

ohp11.dvi 19 11 ( ) 2019.4.20 1 / ( ) n O(n 2 ) O(n 2 ) ( ) 1 d n 1 n logn O(nlogn) n ( n logn C ) 2 ( ) ( merge) 2 1 1 3 1 4 5 4 2 3 7 9 7 1 2 3 4 5 7 9 1: 2 ivec merge 3 ( ) (2) int *ivec_new(int size) { int *a

More information

r11.dvi

r11.dvi 19 11 ( ) 2019.4.20 1 / 1.1 ( n n O(n 2 O(n 2 ) ( 1 d n 1 n logn O(nlogn n ( n logn C 1.2 ( ( merge 2 1 1 3 1 4 5 4 2 3 7 9 7 1 2 3 4 5 7 9 1: 2 ivec merge int *ivec_new(int size) { int *a = (int*)malloc((size+1)

More information

NL-22/NL-32取扱説明書_操作編

NL-22/NL-32取扱説明書_操作編 MIC / Preamp ATT NL-32 A C ATT AMP 1 AMP 2 AMP 3 FLAT FLAT CAL.SIG. OVER LOAD DET. AMP 4 AMP 5 A/D D/A CONV. AMP 6 AMP 7 A/D CONV. Vref. AMP 8 AMP 10 DC OUT AMP 9 FILTER OUT AC DC OUT AC OUT KEY SW Start

More information

卒業論文

卒業論文 Y = ax 1 b1 X 2 b2...x k bk e u InY = Ina + b 1 InX 1 + b 2 InX 2 +...+ b k InX k + u X 1 Y b = ab 1 X 1 1 b 1 X 2 2...X bk k e u = b 1 (ax b1 1 X b2 2...X bk k e u ) / X 1 = b 1 Y / X 1 X 1 X 1 q YX1

More information

c-all.dvi

c-all.dvi III(994) (994) from PSL (9947) & (9922) c (99,992,994,996) () () 2 3 4 (2) 2 Euler 22 23 Euler 24 (3) 3 32 33 34 35 Poisson (4) 4 (5) 5 52 ( ) 2 Turbo 2 d 2 y=dx 2 = y y = a sin x + b cos x x = y = Fortran

More information

untitled

untitled II yacc 005 : 1, 1 1 1 %{ int lineno=0; 3 int wordno=0; 4 int charno=0; 5 6 %} 7 8 %% 9 [ \t]+ { charno+=strlen(yytext); } 10 "\n" { lineno++; charno++; } 11 [^ \t\n]+ { wordno++; charno+=strlen(yytext);}

More information

(lm) lm AIC 2 / 1

(lm) lm AIC 2 / 1 W707 s-taiji@is.titech.ac.jp 1 / 1 (lm) lm AIC 2 / 1 : y = β 1 x 1 + β 2 x 2 + + β d x d + β d+1 + ϵ (ϵ N(0, σ 2 )) y R: x R d : β i (i = 1,..., d):, β d+1 : ( ) (d = 1) y = β 1 x 1 + β 2 + ϵ (d > 1) y

More information

r08.dvi

r08.dvi 19 8 ( ) 019.4.0 1 1.1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( ) 1 next 1 prev 1 head cur tail head cur prev

More information

C V C 6 1 6.1.............................. 1 6.......................... 3 6.3..................... 5 6.4 NULL............................. 8 6.5......................... 9 6.6..............................

More information

() / (front end) (back end) (phase) (pass) 1 2

() / (front end) (back end) (phase) (pass) 1 2 1 () () lex http://www.cs.info.mie-u.ac.jp/~toshi/lectures/compiler/ 2018 4 1 () / (front end) (back end) (phase) (pass) 1 2 () () var left, right; fun int main() { left = 0; right = 10; return ((left

More information

「諸雑公文書」整理の中間報告

「諸雑公文書」整理の中間報告 30 10 3 from to 10 from to ( ) ( ) 20 20 20 20 20 35 8 39 11 41 10 41 9 41 7 43 13 41 11 42 7 42 11 41 7 42 10 4 4 8 4 30 10 ( ) ( ) 17 23 5 11 5 8 8 11 11 13 14 15 16 17 121 767 1,225 2.9 18.7 29.8 3.9

More information

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value = Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value

More information

1 No.1 5 C 1 I III F 1 F 2 F 1 F 2 2 Φ 2 (t) = Φ 1 (t) Φ 1 (t t). = Φ 1(t) t = ( 1.5e 0.5t 2.4e 4t 2e 10t ) τ < 0 t > τ Φ 2 (t) < 0 lim t Φ 2 (t) = 0

1 No.1 5 C 1 I III F 1 F 2 F 1 F 2 2 Φ 2 (t) = Φ 1 (t) Φ 1 (t t). = Φ 1(t) t = ( 1.5e 0.5t 2.4e 4t 2e 10t ) τ < 0 t > τ Φ 2 (t) < 0 lim t Φ 2 (t) = 0 1 No.1 5 C 1 I III F 1 F 2 F 1 F 2 2 Φ 2 (t) = Φ 1 (t) Φ 1 (t t). = Φ 1(t) t = ( 1.5e 0.5t 2.4e 4t 2e 10t ) τ < 0 t > τ Φ 2 (t) < 0 lim t Φ 2 (t) = 0 0 < t < τ I II 0 No.2 2 C x y x y > 0 x 0 x > b a dx

More information

±é½¬£²¡§£Í£Ð£É½éÊâ

±é½¬£²¡§£Í£Ð£É½éÊâ 2012 8 7 1 / 52 MPI Hello World I ( ) Hello World II ( ) I ( ) II ( ) ( sendrecv) π ( ) MPI fortran C wget http://www.na.scitec.kobe-u.ac.jp/ yaguchi/riken2012/enshu2.zip unzip enshu2.zip 2 / 52 FORTRAN

More information

untitled

untitled 1.0 1. Display Format 8*2 Character 2. Power Supply 3.3V 3. Overall Module Size 30.0mm(W) x 19.5mm(H) x max 5.5mm(D) 4. Viewing Aera(W*H) 27.0mm(W) x 10.5mm(H) 5. Dot Size (W*H) 0.45mm(W) x 0.50mm(H) 6.

More information

( 28 ) ( ) ( ) 0 This note is c 2016, 2017 by Setsuo Taniguchi. It may be used for personal or classroom purposes, but not for commercial purp

( 28 ) ( ) ( ) 0 This note is c 2016, 2017 by Setsuo Taniguchi. It may be used for personal or classroom purposes, but not for commercial purp ( 28) ( ) ( 28 9 22 ) 0 This ote is c 2016, 2017 by Setsuo Taiguchi. It may be used for persoal or classroom purposes, but ot for commercial purposes. i (http://www.stat.go.jp/teacher/c2epi1.htm ) = statistics

More information

課題

課題 colormode(hsb,359,99,99); background(0,0,99); s = 99; x = mousex; y = mousey; nostroke(); while(s >= 0 && (0

More information

10K

10K 1 2 3 4 Object Oriented Object Oriented Programming(OOP) 5 6 OOP#1 OOP#2 Java 7 Java 8 手続き型 v.s. OOP #1 OOPのメリット#3 追加 変更がラク 出典 立山秀利 Javaのオブジェクト指向がゼッタイにわかる本 秀和システム 出典 立山秀利 Javaのオブジェクト指向がゼッタイにわかる本 秀和システム

More information

Agenda Motivation How it works Performance Limitation Conclusion

Agenda Motivation How it works Performance Limitation Conclusion py2llvm: Python to LLVM translator Syoyo Fujita Agenda Motivation How it works Performance Limitation Conclusion Agenda Motivation How it works Performance Limitation Conclusion py2llvm Python LLVM Python,

More information

Kageyama (Kobe Univ.) / 36

Kageyama (Kobe Univ.) / 36 DrawArrays DrawElements 05 1 2015.05.19 Kageyama (Kobe Univ.) 2015.05.19 1 / 36 Kageyama (Kobe Univ.) 2015.05.19 2 / 36 Kageyama (Kobe Univ.) 2015.05.19 3 / 36 Web アプリ HTML + CSS + JavaScript + シェーダソースコード

More information

高等学校学習指導要領解説 数学編

高等学校学習指導要領解説 数学編 5 10 15 20 25 30 35 5 1 1 10 1 1 2 4 16 15 18 18 18 19 19 20 19 19 20 1 20 2 22 25 3 23 4 24 5 26 28 28 30 28 28 1 28 2 30 3 31 35 4 33 5 34 36 36 36 40 36 1 36 2 39 3 41 4 42 45 45 45 46 5 1 46 2 48 3

More information

2004 TV Indexing Index Auto-Making Soccer Video Digests :2005 2 2 3603U043-0 Katsunori Kawaguchi 1 7 1.1.................................... 7 1.2.................................. 7 1.3..................................

More information

joho09.ppt

joho09.ppt s M B e E s: (+ or -) M: B: (=2) e: E: ax 2 + bx + c = 0 y = ax 2 + bx + c x a, b y +/- [a, b] a, b y (a+b) / 2 1-2 1-3 x 1 A a, b y 1. 2. a, b 3. for Loop (b-a)/ 4. y=a*x*x + b*x + c 5. y==0.0 y (y2)

More information

関数のグラフを描こう

関数のグラフを描こう L05(2010-05-07) 1 2 hig3.net ( ) L05(2010-05-07) 1 / 16 #i n c l u d e double f ( double x ) ; i n t main ( void ){ i n t n ; i n t nmax=10; double x ; double s =0.0; } x = 1.0; s=s+x ;

More information

2016 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 1 16 2 1 () X O 3 (O1) X O, O (O2) O O (O3) O O O X (X, O) O X X (O1), (O2), (O3) (O2) (O3) n (O2) U 1,..., U n O U k O k=1 (O3) U λ O( λ Λ) λ Λ U λ O 0 X 0 (O2) n =

More information

BRC-X1000

BRC-X1000 C-455-100-02(1) BRC-X1000/H800 2016 Sony Corporation 2 3 4 5 6 4 D E 5 6 7 A B C F G 7 8 9 0 qa qs SYSTEM SELECT IN IR SELECT VISCA RS - 422 OUT OSD OFF CAMERA SETUP 1 qd 2 3 4 5 6 7 8 LAN 12V qf HDMI

More information

α = 2 2 α 2 = ( 2) 2 = 2 x = α, y = 2 x, y X 0, X 1.X 2,... x 0 X 0, x 1 X 1, x 2 X 2.. Zorn A, B A B A B A B A B B A A B N 2

α = 2 2 α 2 = ( 2) 2 = 2 x = α, y = 2 x, y X 0, X 1.X 2,... x 0 X 0, x 1 X 1, x 2 X 2.. Zorn A, B A B A B A B A B B A A B N 2 1. 2. 3. 4. 5. 6. 7. 8. N Z 9. Z Q 10. Q R 2 1. 2. 3. 4. Zorn 5. 6. 7. 8. 9. x x x y x, y α = 2 2 α x = y = 2 1 α = 2 2 α 2 = ( 2) 2 = 2 x = α, y = 2 x, y X 0, X 1.X 2,... x 0 X 0, x 1 X 1, x 2 X 2.. Zorn

More information

fp.gby

fp.gby 1 1 2 2 3 2 4 5 6 7 8 9 10 11 Haskell 12 13 Haskell 14 15 ( ) 16 ) 30 17 static 18 (IORef) 19 20 OK NG 21 Haskell (+) :: Num a => a -> a -> a sort :: Ord a => [a] -> [a] delete :: Eq a => a -> [a] -> [a]

More information

3 3.1 algebraic datatype data k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] B

3 3.1 algebraic datatype data k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] B 3 3.1 algebraic datatype data 1 2... k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] Bob String y Charlie Foo Double Integer Alice 3.14 [1,2],

More information

TF Editor V3.5 ユーザーガイド

TF Editor V3.5 ユーザーガイド DIGITAL MIXING CONSOLE JA - 2 - TF Editor - 3 - TF Editor NOTE - 4 - TF Editor 1. 2. 3. 1. 2. 3. 4. - 5 - TF Editor NOTE NOTE - 6 - TF Editor NOTE - 7 - TF Editor 1 2 3 4 5 6 7 8 9 0 1 2-8 - TF Editor

More information

MPI MPI MPI.NET C# MPI Version2

MPI MPI MPI.NET C# MPI Version2 MPI.NET C# 2 2009 2 27 MPI MPI MPI.NET C# MPI Version2 MPI (Message Passing Interface) MPI MPI Version 1 1994 1 1 1 1 ID MPI MPI_Send MPI_Recv if(rank == 0){ // 0 MPI_Send(); } else if(rank == 1){ // 1

More information

XY-VIDEO CONVERTER XY-22 INSTRUCTION MANUAL T-0006Q3.XPL.XY

XY-VIDEO CONVERTER XY-22 INSTRUCTION MANUAL T-0006Q3.XPL.XY XY-VIDEO CVERTER XY-22 INSTRUCTI MANUAL T-0006Q3.XPL.XY OUTLINE SPECIAL FEATURE APPLICATIS Mixing Consle PROGRAM OUT L,R INPUT XY-22 XY-VIDEO CVERTER INPUT OUTPUT HORIZTAL VERTICAL POWER VIDEO BYPASS

More information

A A = a 41 a 42 a 43 a 44 A (7) 1 (3) A = M 12 = = a 41 (8) a 41 a 43 a 44 (3) n n A, B a i AB = A B ii aa

A A = a 41 a 42 a 43 a 44 A (7) 1 (3) A = M 12 = = a 41 (8) a 41 a 43 a 44 (3) n n A, B a i AB = A B ii aa 1 2 21 2 2 [ ] a 11 a 12 A = a 21 a 22 (1) A = a 11 a 22 a 12 a 21 (2) 3 3 n n A A = n ( 1) i+j a ij M ij i =1 n (3) j=1 M ij A i j (n 1) (n 1) 2-1 3 3 A A = a 11 a 12 a 13 a 21 a 22 a 23 a 31 a 32 a 33

More information

untitled

untitled 2004/12/21 2/2 (11/16) DT-MRI (11/30) /OpenGL 12/7 12/14 (12/21) 1/11 (1/18) OpenGL ~ ~ OpenGL Silicon Graphics, OpenGL ~ ~ OpenGL OpenGL Utility Library (GLU) OpenGL. OpenGL. OpenGL Utility Toolkit (GLUT)

More information

USB 0.6 https://duet.doshisha.ac.jp/info/index.jsp 2 ID TA DUET 24:00 DUET XXX -YY.c ( ) XXX -YY.txt() XXX ID 3 YY ID 5 () #define StudentID 231

USB 0.6 https://duet.doshisha.ac.jp/info/index.jsp 2 ID TA DUET 24:00 DUET XXX -YY.c ( ) XXX -YY.txt() XXX ID 3 YY ID 5 () #define StudentID 231 0 0.1 ANSI-C 0.2 web http://www1.doshisha.ac.jp/ kibuki/programming/resume p.html 0.3 2012 1 9/28 0 [ 01] 2 10/5 1 C 2 3 10/12 10 1 2 [ 02] 4 10/19 3 5 10/26 3 [ 03] 6 11/2 3 [ 04] 7 11/9 8 11/16 4 9 11/30

More information

Nikon スピードライト SB-900 使用説明書

Nikon スピードライト SB-900 使用説明書 Jp A A 2 k ka-6 k ka-4 k SB-900 kb-4 SB-900 k kf-22 k kf-2 SB-900 SB-900 CLS CPU t CPU CPU CPU A 3 CLS CLS ISO 35mm ISO v t CPU IX A A A 4 C-2 C-10 F-3 C-8 C-4 / F-21 C-27 C-20 D-60 D-26 C-9 C-24 C-25

More information