本文整理汇总了C++中point::get_y方法的典型用法代码示例。如果您正苦于以下问题:C++ point::get_y方法的具体用法?C++ point::get_y怎么用?C++ point::get_y使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类point
的用法示例。
在下文中一共展示了point::get_y方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set_point
void line::set_point(point p1, point p2) {
this->p1.set_x(p1.get_x());
this->p1.set_y(p1.get_y());
this->p2.set_x(p2.get_x());
this->p2.set_y(p2.get_y());
}
示例2:
parachute::parachute(point center) {
this->radius = 60;
this->center = center;
for (int i=0; i<4; i++) {
// 4 titik di bagian bawah parasut
point_parachute[i].set_x(center.get_x()-radius+i*(radius/3)*2);
point_parachute[i].set_y(center.get_y());
}
point_parachute[4].set_x(center.get_x()); // titik temu tali parasut
point_parachute[4].set_y(center.get_y() + 60);
point_parachute[5].set_x(center.get_x()); // pusat kepala
point_parachute[5].set_y(center.get_y() + 40);
point_parachute[6].set_x(center.get_x() - 10); // kiri atas badan
point_parachute[6].set_y(center.get_y() + 45);
// koordinat untuk polygon badan
people.add_point(5,7);
people.add_point(17,7);
people.add_point(22,12);
people.add_point(22,15);
people.add_point(17,10);
people.add_point(17,40);
people.add_point(14,40);
people.add_point(14,30);
people.add_point(8,30);
people.add_point(8,40);
people.add_point(5,40);
people.add_point(5,10);
people.add_point(0,15);
people.add_point(0,12);
people.scale(1);
}
示例3: calc_length
//
// Calculate the distance between two points.
//
float edge::calc_length( const point& a, const point& b )
{
int dx = a.get_x() - b.get_x();
int dy = a.get_y() - b.get_y();
return static_cast<float>(
std::sqrt( static_cast<double>( dx * dx + dy * dy ) ) );
}
示例4:
err pcd8544< Spi, Cs_gpio, Mode_gpio, Rst_gpio >::clear_point(const point& coord)
{
// TODO: checks
// TODO: common parts (see set_point())
int x = coord.get_x();
int y = coord.get_y();
if (x < 0 || y < 0 || x > 83 || y > 47)
return -1;
// Calculate a byte offcet
int y_byte = y >> 3;
// Calculate a bit offcet inside a byte
int y_bit = y & 0x7;
// Clear appropriate bit
m_array[x][y_byte] &= ~(1 << y_bit);
return 0;
}
示例5:
bool operator ==(const point &p1, const point &p2)
{
return ( p1.get_x() == p2.get_x() &&
p2.get_y() == p2.get_y() );
}
示例6: translate
void point::translate(point p2) {
set_x(x + p2.get_x());
set_y(y + p2.get_y());
}
示例7: twopointdist
double point::twopointdist(point p2) {
return sqrt( pow((x-p2.get_x()),2) + pow((y-p2.get_y()),2) ) ;
}
示例8:
line::line(point _p1, point _p2) : p1(_p1.get_x(), _p1.get_y()), p2(_p2.get_x(), _p2.get_y()) {}
示例9: cmp_y
bool point::cmp_y(const point& p1, const point& p2) {
return p1.get_y() < p2.get_y();
}
示例10:
point::point(point const& p):
x(p.get_x()),
y(p.get_y())
{}