/***************************************************************************
** **
** QCustomPlot, an easy to use, modern plotting widget for Qt **
** Copyright (C) 2011-2017 Emanuel Eichhammer **
** **
** This program is free software: you can redistribute it and/or modify **
** it under the terms of the GNU General Public License as published by **
** the Free Software Foundation, either version 3 of the License, or **
** (at your option) any later version. **
** **
** This program is distributed in the hope that it will be useful, **
** but WITHOUT ANY WARRANTY; without even the implied warranty of **
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
** GNU General Public License for more details. **
** **
** You should have received a copy of the GNU General Public License **
** along with this program. If not, see http://www.gnu.org/licenses/. **
** **
****************************************************************************
** Author: Emanuel Eichhammer **
** Website/Contact: http://www.qcustomplot.com/ **
** Date: 04.09.17 **
** Version: 2.0.0 **
****************************************************************************/
#include "qcustomplot.h"
/* including file 'src/vector2d.cpp', size 7340 */
/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */
////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////// QCPVector2D
////////////////////////////////////////////////////////////////////////////////////////////////////
/*! \class QCPVector2D
\brief Represents two doubles as a mathematical 2D vector
This class acts as a replacement for QVector2D with the advantage of double precision instead of
single, and some convenience methods tailored for the QCustomPlot library.
*/
/* start documentation of inline functions */
/*! \fn void QCPVector2D::setX(double x)
Sets the x coordinate of this vector to \a x.
\see setY
*/
/*! \fn void QCPVector2D::setY(double y)
Sets the y coordinate of this vector to \a y.
\see setX
*/
/*! \fn double QCPVector2D::length() const
Returns the length of this vector.
\see lengthSquared
*/
/*! \fn double QCPVector2D::lengthSquared() const
Returns the squared length of this vector. In some situations, e.g. when just trying to find the
shortest vector of a group, this is faster than calculating \ref length, because it avoids
calculation of a square root.
\see length
*/
/*! \fn QPoint QCPVector2D::toPoint() const
Returns a QPoint which has the x and y coordinates of this vector, truncating any floating point
information.
\see toPointF
*/
/*! \fn QPointF QCPVector2D::toPointF() const
Returns a QPointF which has the x and y coordinates of this vector.
\see toPoint
*/
/*! \fn bool QCPVector2D::isNull() const
Returns whether this vector is null. A vector is null if \c qIsNull returns true for both x and y
coordinates, i.e. if both are binary equal to 0.
*/
/*! \fn QCPVector2D QCPVector2D::perpendicular() const
Returns a vector perpendicular to this vector, with the same length.
*/
/*! \fn double QCPVector2D::dot() const
Returns the dot/scalar product of this vector with the specified vector \a vec.
*/
/* end documentation of inline functions */
/*!
Creates a QCPVector2D object and initializes the x and y coordinates to 0.
*/
QCPVector2D::QCPVector2D() :
mX(0),
mY(0)
{
}
/*!
Creates a QCPVector2D object and initializes the \a x and \a y coordinates with the specified
values.
*/
QCPVector2D::QCPVector2D(double x, double y) :
mX(x),
mY(y)
{
}
/*!
Creates a QCPVector2D object and initializes the x and y coordinates respective coordinates of
the specified \a point.
*/
QCPVector2D::QCPVector2D(const QPoint &point) :
mX(point.x()),
mY(point.y())
{
}
/*!
Creates a QCPVector2D object and initializes the x and y coordinates respective coordinates of
the specified \a point.
*/
QCPVector2D::QCPVector2D(const QPointF &point) :
mX(point.x()),
mY(point.y())
{
}
/*!
Normalizes this vector. After this operation, the length of the vector is equal to 1.
\see normalized, length, lengthSquared
*/
void QCPVector2D::normalize()
{
double len = length();
mX /= len;
mY /= len;
}
/*!
Returns a normalized version of this vector. The length of the returned vector is equal to 1.
\see normalize, length, lengthSquared
*/
QCPVector2D QCPVector2D::normalized() const
{
QCPVector2D result(mX, mY);
result.normalize();
return result;
}
/*! \overload
Returns the squared shortest distance of this vector (interpreted as a point) to the finite line
segment given by \a start and \a end.
\see distanceToStraightLine
*/
double QCPVector2D::distanceSquaredToLine(const QCPVector2D &start, const QCPVector2D &end) const
{
QCPVector2D v(end-start);
double vLengthSqr = v.lengthSquared();
if (!qFuzzyIsNull(vLengthSqr))
{
double mu = v.dot(*this-start)/vLengthSqr;
if (mu < 0)
return (*this-start).lengthSquared();
else if (mu > 1)
return (*this-end).lengthSquared();
else
return ((start + mu*v)-*this).lengthSquared();
} else
return (*this-start).lengthSquared();
}
/*! \overload
Returns the squared shortest distance of this vector (interpreted as a point) to the finite line
segment given by \a line.
\see distanceToStraightLine
*/
double QCPVector2D::distanceSquaredToLine(const QLineF &line) const
{
return distanceSquaredToLine(QCPVector2D(line.p1()), QCPVector2D(line.p2()));
}
/*!
Returns the shortest distance of this vector (interpreted as a point) to the infinite straight
line given by a \a base point and a \a direction vector.
\see distanceSquaredToLine
*/
double QCPVector2D::distanceToStraightLine(const QCPVector2D &base, const QCPVector2D &direction) const
{
return qAbs((*this-base).dot(direction.perpendicular()))/direction.length();
}
/*!
Scales this vector by the given \a factor, i.e. the x and y components are multiplied by \a
factor.
*/
QCPVector2D &QCPVector2D::operator*=(double factor)
{
mX *= factor;
mY *= factor;
return *this;
}
/*!
Scales this vector by the given \a divisor, i.e. the x and y components are divided by \a
divisor.
*/
QCPVector2D &QCPVector2D::operator/=(double divisor)
{
mX /= divisor;
mY /= divisor;
return *this;
}
/*!
Adds the given \a vector to this vector component-wise.
*/
QCPVector2D &QCPVector2D::operator+=(const QCPVector2D &vector)
{
mX += vector.mX;
mY += vector.mY;
return *this;
}
/*!
subtracts the given \a vector from this vector component-wise.
*/
QCPVector2D &QCPVector2D::operator-=(const QCPVector2D &vector)
{
mX -= vector.mX;
mY -= vector.mY;
return *this;
}
/* end of 'src/vector2d.cpp' */
/* including file 'src/painter.cpp', size 8670 */
/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */
////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////// QCPPainter
////////////////////////////////////////////////////////////////////////////////////////////////////
/*! \class QCPPainter
\brief QPainter subclass used internally
没有合适的资源?快使用搜索试试~ 我知道了~
Qt读取地震数据(segd,segy,seg2)并且转化为频域数据
共1146个文件
idx:1020个
o:27个
h:24个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 201 浏览量
2023-07-10
17:25:26
上传
评论 1
收藏 23.14MB ZIP 举报
温馨提示
可以查看segd等地震数据通过FFT转化为幅度谱,功率谱已经相位谱。以及进行相干性对比数据
资源推荐
资源详情
资源评论
收起资源包目录
Qt读取地震数据(segd,segy,seg2)并且转化为频域数据 (1146个子文件)
libfftwconnect.a 124KB
COPYING 18KB
COPYRIGHT 863B
qcustomplot.cpp 1.07MB
moc_qcustomplot.cpp 283KB
moc_qcustomplot.cpp 283KB
widget.cpp 28KB
BaseDebug.cpp 17KB
ep_work.cpp 12KB
moc_widget.cpp 10KB
moc_widget.cpp 8KB
moc_ep_work.cpp 8KB
moc_ep_work.cpp 7KB
BaseFile.cpp 4KB
BaseTime.cpp 3KB
moc_fft.cpp 3KB
moc_fft.cpp 3KB
BaseVector.cpp 2KB
BitOperator.cpp 2KB
BaseMemory.cpp 2KB
BaseLock.cpp 1KB
BaseThread.cpp 749B
main.cpp 224B
BaseSize.cpp 1B
Makefile.Debug 221KB
object_script.xiangganxing.Debug 306B
libfftw3f-3.def 24KB
libfftw3f-3.def 24KB
libfftw3-3.def 24KB
libfftw3-3.def 24KB
libfftw3l-3.def 14KB
libfftw3l-3.def 14KB
libfftw3f-3.dll 2.64MB
libfftw3f-3.dll 2.64MB
libfftw3-3.dll 2.59MB
libfftw3-3.dll 2.59MB
libfftw3-3.dll 2.59MB
libfftw3-3.dll 2.59MB
libfftw3l-3.dll 1.19MB
libfftw3l-3.dll 1.19MB
fftwconnect.dll 116KB
xiangganxing.exe 15.18MB
xiangganxing.exe 921KB
benchf.exe 402KB
bench.exe 391KB
benchl.exe 371KB
fftwf-wisdom.exe 180KB
fftwl-wisdom.exe 180KB
fftw-wisdom.exe 180KB
libfftw3f-3.exp 146KB
libfftw3-3.exp 143KB
libfftw3-3.exp 141KB
libfftw3l-3.exp 88KB
fftw3.f 2KB
fftw3.f03 55KB
fftw3l.f03 27KB
fftw3q.f03 26KB
qcustomplot.h 261KB
BaseType.h 98KB
BaseDefine.h 21KB
fftw3.h 20KB
fftw3.h 18KB
fftw3.h 18KB
moc_predefs.h 15KB
moc_predefs.h 15KB
BaseFunction.h 13KB
BaseDebug.h 4KB
widget.h 2KB
ep_work.h 2KB
BaseSize.h 2KB
BaseFile.h 2KB
BitOperator.h 939B
BaseVector.h 787B
BaseTable.h 781B
basecallproc.h 728B
fcorrelate.h 704B
BaseMemory.h 649B
BaseLock.h 548B
BaseThread.h 452B
BaseTime.h 443B
BaseEvent.h 435B
qopenglext.h.D5BA90C3C3E4A322.idx 563KB
qcustomplot.cpp.50DA16B1498C297B.idx 539KB
qcustomplot.h.0809ECC6B93B79EA.idx 474KB
random.tcc.A0804F6DE5021D6F.idx 404KB
winuser.h.3751DD37EC054667.idx 341KB
winnt.h.2F10FB53B614F87E.idx 301KB
wingdi.h.8D85C3D2A09E0F12.idx 297KB
wincrypt.h.FAE4BCAE6058B97B.idx 251KB
random.h.081A70B324D013EE.idx 226KB
urlmon.h.1655E1A3CFB9B946.idx 190KB
BaseType.h.9A19A123AE08000C.idx 183KB
BaseType.h.3EB280CA1BF2BB71.idx 182KB
mmsystem.h.65C85037CB215040.idx 177KB
winbase.h.2E8E4041E50622CC.idx 169KB
objidl.h.0D86026C144028F8.idx 167KB
oaidl.h.6D6FCCD500CB4499.idx 162KB
emmintrin.h.3C378C2BCA599D7B.idx 149KB
qnamespace.h.F401220005E5A96D.idx 146KB
hypergeometric.tcc.95FE3A4C4E5E1760.idx 145KB
共 1146 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
- 创业虚与实2024-03-31这个资源对我启发很大,受益匪浅,学到了很多,谢谢分享~
加油吧,小杜
- 粉丝: 2579
- 资源: 26
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功