circle

图(一)-数据结构学习笔记

a 夏天 提交于 2020-02-25 23:48:56
文章目录 1. 图简介 1.1 图的分类 1.2 图的描述 1.2.1 边的描述 1.2.2 路径(path)/环路(circle) 路径描述 路径分类 2. 如何使用代码描述图 2.1 邻接矩阵(adjacency matrix)和关联矩阵() 2.1.1 邻接矩阵 2.1.2 关联矩阵(incidence matrix) 1. 图简介 1.1 图的分类 图分为 有向图 (digraph): 即所有边皆有向的图 无向图 (undigraph): 即所有边皆无向的图 混合图(mixed graph): 即含有无向以及有向边的图 虽然图分为上面三种, 但是我们重点分析有向图, 因为所有的图都可以由有向图简化得到 1.2 图的描述 基于任意一个图都可以由点集V 与边集 E组成 , 我们可以对图 G 做出如下描述 G = ( V ; E ) G = (V;E) G = ( V ; E ) V(vertex): V 代表图的点集, 我们令 n = ∣ V ∣ n = |V| n = ∣ V ∣ ,n代表顶点的个数 E(edge): E 代表图的边集, 我们令 e = ∣ E ∣ e = |E| e = ∣ E ∣ , e代表边的个数 1.2.1 边的描述 我们使用 ( u , v ) (u,v) ( u , v ) 来描述一条边 若u,v的次序无所谓, 则称为 无向边(undirected

【翻译】4种CSS画圆的方法

狂风中的少年 提交于 2020-02-10 02:29:28
四种方法 1. Border Radius .circle { background: #456BD9; border: 0.1875em solid #0F1C3F; border-radius: 50%; box-shadow: 0.375em 0.375em 0 0 rgba(15, 28, 63, 0.125); height: 5em; width: 5em; } 将border-radius设为50%是最常见、支持最广泛的方法。border-radius属性同时会影响边框、阴影,以及元素的 点击面积 。 2. SVG <svg viewBox="0 0 80 80" width="80" height="80"> <circle class="circle" cx="40" cy="40" r="38"/> </svg> SVG有circle元素,可以实现圆形。SVG的支持也很广泛,而且用作动画性能很好,但代码量略大。要注意,为了防止圆形视觉上被遮罩,确保圆的半径(如果有笔画宽度,也要加上)比SVG的viewBox略小一点。 3. Clip Path .circle { background: #456BD9; clip-path: circle(50%); height: 5em; width: 5em; } Clip path是新的技术。支持也很广但一致性不足

python趣题

谁都会走 提交于 2020-02-07 08:03:49
1. 用turtle模块画奥运五环 import turtle t = turtle . Pen ( ) t . width ( 8 ) t . color ( 'blue' ) t . circle ( 50 ) t . penup ( ) t . forward ( 130 ) t . pendown ( ) t . color ( 'black' ) t . circle ( 50 ) t . penup ( ) t . forward ( 130 ) t . pendown ( ) t . color ( 'red' ) t . circle ( 50 ) t . penup ( ) t . goto ( 66 , - 50 ) t . pendown ( ) t . color ( 'yellow' ) t . circle ( 50 ) t . penup ( ) t . forward ( 130 ) t . pendown ( ) t . color ( 'green' ) t . circle ( 50 ) 2. 生成二维吗 需要依赖第三至少两个第三方库,依次安装即可: pip install Image pip install qrcode 代码很简单 import qrcode qrcode . make ( "张威真帅" ) . save ( "./test

C++流操作符重载,多文件实现

血红的双手。 提交于 2020-02-07 07:48:31
C++流操作符重载,多个文件实现 主文件:main.cpp Point头文件:Point.h Point源文件:Point.cpp Circle头文件:Circle.h Circle源文件:Circle.cpp Cylinder头文件:Cylinder.h Cylinder源文件:Cylinder.cpp Output 主文件:main.cpp #include<iostream> #include<cstring> #include"Point.h" #include"Circle.h" #include"Cylinder.h" void main(void) { Cylinder cy1(3.5, 6.4, 5.2, 10); std::cout << "\noriginal cylinder:\nx=" << cy1.getX() << ",y=" << cy1.getY() << ",r=" << cy1.getRadius() << ",h=" << cy1.getHeight() << "\narea=" << cy1.area() << ",volume=" << cy1.volume() << std::endl; cy1.setHeight(15); cy1.setRadius(7.5); cy1.setPoint(5, 5); std::cout << "

圆环进度条

自古美人都是妖i 提交于 2020-02-05 07:31:32
    圆环进度条,根据环内的数字,实现百分比进度。希望大家多多指点。 <!DOCTYPE html> <html> <head lang="en"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <script type="text/javascript" src="http://libs.baidu.com/jquery/2.0.3/jquery.min.js"></script> <title>圆环进度条</title> <style> * {margin: 0;padding: 0} .container .first { left: 10px; top: 20px; } .container .second { left: 10px; top: 100px; } .container .third { left: 10px; top: 180px; } .container .fourth { left: 10px; top: 260px; } .circle

使用接口作为返回值

懵懂的女人 提交于 2020-02-03 05:16:34
1 using System; 2 3 using System.Collections.Generic; 4 5 using System.Text; 6 7 namespace Example10_9 8 9 { 10 11 class Program 12 13 { 14 15 static void Main( string [] args) 16 17 { 18 19 // 创建Circle类变量circle,并使用其作为参数创建MyClass型变量myClass 20 21 Circle circle = new Circle( 35 ); 22 23 MyClass myClass = new MyClass(circle); 24 25 26 27 // 获取返回值,并输出其面积Area属性 28 29 Circle circle1 = (Circle)myClass.MyOutput(circle); 30 31 Console.WriteLine(circle1.Area); 32 33 Console.ReadLine(); 34 35 } 36 37 } 38 39 /**/ /// <summary> 40 41 /// IShape接口 42 43 /// </summary> 44 45 interface IShape 46 47 { 48 49 /

PAT 乙级 1050 螺旋矩阵 (25分)

≡放荡痞女 提交于 2020-01-30 09:23:03
1050 螺旋矩阵 (25分) 本题要求将给定的 N 个正整数按非递增的顺序,填入“螺旋矩阵”。所谓“螺旋矩阵”,是指从左上角第 1 个格子开始,按顺时针螺旋方向填充。要求矩阵的规模为 m 行 n 列,满足条件:m×n 等于 N;m≥n;且 m−n 取所有可能值中的最小值。 输入格式: 输入在第 1 行中给出一个正整数 N,第 2 行给出 N 个待填充的正整数。所有数字不超过 104,相邻数字以空格分隔。 输出格式: 输出螺旋矩阵。每行 n 个数字,共 m 行。相邻数字以 1 个空格分隔,行末不得有多余空格。 输入样例: 12 37 76 20 98 76 42 53 95 60 81 58 93 输出样例: 98 95 93 42 37 81 53 20 76 58 60 76 作者: CHEN, Yue 单位: 浙江大学 时间限制: 200 ms 内存限制: 64 MB 代码长度限制: 16 KB # include <iostream> # include <vector> # include <cstring> # include <cmath> # include <algorithm> using namespace std ; bool cmp ( int a , int b ) { return a > b ? true : false ; } int main (

PCL根据空间点云拟合圆

大憨熊 提交于 2020-01-10 22:24:07
参考文档: //http://docs.pointclouds.org/1.9.1/classpcl_1_1_sample_consensus_model_circle3_d.html //使用PCL绘制空间圆 //https://blog.csdn.net/zyj8691/article/details/79416733 //http://www.pcl-users.org/RANSAC-Model-Coefficients-td4041435.html //http://www.pcl-users.org/SOLVED-Terrible-circle-fitting-results-with-SampleConsensusModelCircle3D-td4043214.html //http://docs.pointclouds.org/1.9.1/group__sample__consensus.html //[center.x, center.y, center.z, radius, normal.x, normal.y, normal.z] //http://pointclouds.org/documentation/tutorials/random_sample_consensus.php#random-sample-consensus pcl::PointCloud

JavaScript prototype实现静态方法(原型继承)

落爺英雄遲暮 提交于 2020-01-07 22:02:50
原型继承 function Circle (radius) { // instance members this.radius = radius } // Prototype members Circle.prototype.draw = function() { console.log('draw') } const c1 = new Circle(1) const c2 = new Circle(2) 修改原型方法 function Circle (radius) { // instance members this.radius = radius } // Prototype members Circle.prototype.draw = function() { console.log('draw') } Circle.prototype.toString = function() { console.log(`radius is ${this.radius}`) } const c1 = new Circle(1) const c2 = new Circle(2) 原型方法调用实例方法 function Circle (radius) { // instance members this.radius = radius this.move = function() {

无缝轮播

ぐ巨炮叔叔 提交于 2020-01-03 12:40:04
HTML <div id="box">   <ul id="ul">     <li><img src="随堂案例/img/1.jpg" alt=""></li>     <li><img src="随堂案例/img/2.jpg" alt=""></li>     <li><img src="随堂案例/img/3.jpg" alt=""></li>   </ul>   <div id="leftright">     <aside><</aside>     <aside>></aside>   </div>   <div id="circle">     <nav class="black"></nav>     <nav></nav>     <nav></nav>   </div> </div> JS var oBox = document.getElementById("box"); var ul = document.getElementById("ul"); var li = document.getElementsByTagName("li"); var leftright = document.getElementById("leftright"); var circle = document.querySelectorAll("#circle>nav"); var