本文整理汇总了C++中ry函数的典型用法代码示例。如果您正苦于以下问题:C++ ry函数的具体用法?C++ ry怎么用?C++ ry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ry函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: random_robot_pos2
static Pos2 random_robot_pos2(const FieldGeometry *f) {
std::uniform_real_distribution<Float> rx(
-f->field_length / 2 + ROBOT_DIAM / 2,
f->field_length / 2 + ROBOT_DIAM / 2);
std::uniform_real_distribution<Float> ry(-f->field_width / 2 + ROBOT_DIAM / 2,
f->field_width / 2 + ROBOT_DIAM / 2);
std::uniform_real_distribution<Float> rw(-RAD(180), RAD(180));
// return std::forward(rx(gen), ry(gen), rw(gen));
return {rx(gen), ry(gen), rw(gen)};
}
示例2: rtest_eq_dom_check
RelTest
rtest_eq_dom_check(View x, View y) {
ViewRanges<View> rx(x), ry(y);
while (rx() && ry()) {
if (rx.max() < ry.min()) {
++rx;
} else if (ry.max() < rx.min()) {
++ry;
} else return RT_MAYBE;
}
return RT_FALSE;
}
示例3: rect
Path SVGRectElement::toPathData() const
{
FloatRect rect(x().value(this), y().value(this), width().value(this), height().value(this));
bool hasRx = hasAttribute(SVGNames::rxAttr);
bool hasRy = hasAttribute(SVGNames::ryAttr);
if (hasRx || hasRy) {
float _rx = hasRx ? rx().value(this) : ry().value(this);
float _ry = hasRy ? ry().value(this) : rx().value(this);
return Path::createRoundedRectangle(rect, FloatSize(_rx, _ry));
}
return Path::createRectangle(rect);
}
示例4: x
KCanvasPath* SVGRectElement::toPathData() const
{
float _x = x()->baseVal()->value(), _y = y()->baseVal()->value();
float _width = width()->baseVal()->value(), _height = height()->baseVal()->value();
bool hasRx = hasAttribute(String("rx").impl());
bool hasRy = hasAttribute(String("ry").impl());
if(hasRx || hasRy)
{
float _rx = hasRx ? rx()->baseVal()->value() : ry()->baseVal()->value();
float _ry = hasRy ? ry()->baseVal()->value() : rx()->baseVal()->value();
return KCanvasCreator::self()->createRoundedRectangle(_x, _y, _width, _height, _rx, _ry);
}
return KCanvasCreator::self()->createRectangle(_x, _y, _width, _height);
}
示例5: ry
//////////////////////////////////////////////////////////////////////
/// @brief Add the circle and assign the position and radius with yellow
/// @param pos
/// @param vel
//////////////////////////////////////////////////////////////////////
void Physicsworld::addYellowObject(Vec4 pos,Vec4 vel)
{
Rigidbody ry(pos, 1.0f, colour.yellow().r,colour.yellow().g,colour.yellow().b);
ry.setVelocity(vel);
Objectslist.push_back(ry);
}
示例6: rx
void XYView::request(Requisition& req) const {
TransformSetter::request(req);
Requirement rx(xsize_orig_);
Requirement ry(ysize_orig_);
req.require_x(rx);
req.require_y(ry);
}
示例7: rx
void VStrut::request(Requisition& requisition) const {
Coord height = ascent_ + descent_;
Requirement rx(natural_, stretch_, shrink_, 0);
Requirement ry(height, 0, 0, (height == 0) ? 0 : descent_ / height);
requisition.require(Dimension_X, rx);
requisition.require(Dimension_Y, ry);
}
示例8: shapeMarginBounds
LineSegment RectangleShape::getExcludedInterval(LayoutUnit logicalTop, LayoutUnit logicalHeight) const
{
const FloatRect& bounds = shapeMarginBounds();
if (bounds.isEmpty())
return LineSegment();
float y1 = logicalTop.toFloat();
float y2 = (logicalTop + logicalHeight).toFloat();
if (y2 < bounds.y() || y1 >= bounds.maxY())
return LineSegment();
float x1 = bounds.x();
float x2 = bounds.maxX();
float marginRadiusX = rx() + shapeMargin();
float marginRadiusY = ry() + shapeMargin();
if (marginRadiusY > 0) {
if (y2 < bounds.y() + marginRadiusY) {
float yi = y2 - bounds.y() - marginRadiusY;
float xi = ellipseXIntercept(yi, marginRadiusX, marginRadiusY);
x1 = bounds.x() + marginRadiusX - xi;
x2 = bounds.maxX() - marginRadiusX + xi;
} else if (y1 > bounds.maxY() - marginRadiusY) {
float yi = y1 - (bounds.maxY() - marginRadiusY);
float xi = ellipseXIntercept(yi, marginRadiusX, marginRadiusY);
x1 = bounds.x() + marginRadiusX - xi;
x2 = bounds.maxX() - marginRadiusX + xi;
}
}
return LineSegment(x1, x2);
}
示例9: cx
KCanvasPath* SVGEllipseElement::toPathData() const
{
float _cx = cx()->baseVal()->value(), _cy = cy()->baseVal()->value();
float _rx = rx()->baseVal()->value(), _ry = ry()->baseVal()->value();
return KCanvasCreator::self()->createEllipse(_cx, _cy, _rx, _ry);
}
示例10: ry
void TextLine::request(Requisition& requisition) const
{
FontBoundingBox fbb;
font_->font_bbox(fbb);
Text::request(requisition);
Requirement ry(fbb.ascent() + fbb.descent(), 0, 0, 0);
requisition.require(Dimension_Y, ry);
}
示例11: post_false
forceinline ExecStatus
post_false(Home home, ViewArray<VX>& x, const IntSet& y) {
for (int i = x.size(); i--; ) {
IntSetRanges ry(y);
GECODE_ME_CHECK(x[i].minus_r(home,ry,false));
}
return ES_OK;
}
示例12: rx
//---------------------------------------------------------------------------
void __fastcall TForm1::updateedits(TObject *Sender)
{
CSpinNr->MaxValue = Ilosc-1;
EditX->Text = rx(L[Nr].x);
EditY->Text = ry(L[Nr].y);
EditQ->Text = L[Nr].q;
EditR->Text = L[Nr].r;
}
示例13: drawpiece
void drawpiece (WINDOW *w, int y, int x, int rot, int piece, int color) {
int c, d;
wattrset (w, COLOR_PAIR (color));
for (d = 0; d < 4; d++) for (c = 0; c < 4; c++)
if (blocks[rx(rot % rots[piece], d, c)][piece][ry(rot % rots[piece], d, c)] != '.')
mvwaddstr (w, d + y, (c + x - 1) * 2 - 1, " "); /* 2 spaces */
}
示例14: mapToVideo
QPointF VideoRendererItem::mapToVideo(const QPointF &pos) {
auto hratio = d->mposd->targetSize().width()/d->vtx.width();
auto vratio = d->mposd->targetSize().height()/d->vtx.height();
auto p = pos - d->vtx.topLeft();
p.rx() *= hratio;
p.ry() *= vratio;
return p;
}
示例15: DivideByZeroException
Point&
Point::operator/=(const int divisor) {
if (divisor == 0)
throw DivideByZeroException();
rx() /= divisor;
ry() /= divisor;
return *this;
}