c语言 boid,从零开始的全栈工程师——html篇1.3

本文介绍了CSS中关于文本和字体样式的使用,包括颜色、对齐、修饰、缩进等,并列举了前期英语单词,如HTML标签和CSS属性,如color、text-align、font-family等,为前端开发者提供了快速参考。
摘要由CSDN通过智能技术生成

文本、字体css样式与前期英语单词汇总

一、文本样式(text)

1.颜色:color:red;

2.文本对齐方式:text-align:left/center/right/justify;

left:左对齐

center:居中对齐

reght:右对齐

justify:两端对齐

3.文本修饰:text-decoration:none/overline/underline/line-through;

none:空

overline:上划线

underline:下划线

line-through:删除线

4.文本缩进:text-indent:20px;

indent:缩进

二、字体样式(font)

1.字体大小:fot-size:20px;

sizi:大小

2.字体颜色:color:red;     注意不要写成font-color:red;

3.字体形状:font-style:normal/italic/oblique/inherit; (这个了解一下就行一般用不到)

0e9b7619aa2c2e65ef427189d8f9c55e.png

4.字体字形:font-family:"微软雅黑/宋体/楷体";(默认微软雅黑)

5.字体加粗:font-weight:bold;(后面也可跟数字)

400是正常  比400大是加粗 比400小 是变细 不带px

前期英语单词汇总

html单词

doctype 文档

html 网页

head 头部

body 身体;主体

paragraph 段落

title 题目

CSS单词

color 颜色style 样式

background 背景

background-position 背景位置

background-size 背景大小

background-repeat 背景平铺

position 位置

relative 相对的

absolute 绝对的

font-style 字体样式

font-family 字体字形

font-weight 字体粗细

font 字体

width 宽

height 高

line-height行高

float 浮动

overflow 超出

text-align 文本对齐

vertical-align 垂直对齐

text-indent 文本缩进

text-decoration 文本修饰

border边框

border-color 边框颜色

border-style 边框样式

border-width 边框粗细

content 内容

margin 外边距

margin-top 上边距

margin-left 左边距

margin-right 右边距

margin-bottom 下边距

padding 内边距

padding-top 上内边距

padding-left 左内边距

padding-right 右内边距

padding-bottom 下内边距

outline 外线

CSS属性值单词

url 路径

normal 正常

left 左

right 右

center 居中

top 上

bottom 底部

hidden 隐藏

scroll 滚动条

solid 实线

dashed 虚线

bold 加粗

overline 上划线

underline 下划线

line-through 删除线

middle 居中

no-repeat 不平铺

none 空

拓展

src 路径

name 名字

rowspan 上下合并(跨行合并)

colspan 水平合并(跨列合并)

cellspacing 单元格间距

cellpadding 单元格内间距

ul 无序列表

ol 有序列表

li 一列

dl 自定义列表

list-style 列表样式

disc 实心圆

circle 空心圆

square 正方形

boid 模型是一种模拟鸟群行为的计算模型,它描述了鸟群中每只鸟的简单行为规则,如飞行速度、方向和与其他鸟的距离等,通过这些规则的相互作用,可以模拟出群体整体的集体行为。 下面是一个简单的用 Python 编写的 boid 模型程序: ```python import numpy as np import matplotlib.pyplot as plt # 初始化参数 num_boids = 100 # 鸟群中的鸟的数量 size = 100 # 模拟空间的大小 speed_limit = 5 # 鸟的最大速度 sight_distance = 10 # 鸟的视野距离 cohesion_factor = 0.01 # 群体凝聚力因子 separation_factor = 0.1 # 群体分离力因子 alignment_factor = 0.1 # 群体一致性因子 # 生成鸟群随机初始位置和速度 positions = np.random.rand(2, num_boids) * size velocities = np.random.rand(2, num_boids) * speed_limit # 模拟鸟群行为 for _ in range(100): # 计算每只鸟的三个力的总和 cohesion_force = np.mean(positions, axis=1) - positions separation_force = 1 / np.linalg.norm(positions[:, :, np.newaxis] - positions[:, np.newaxis, :], axis=1) alignment_force = np.mean(velocities, axis=1) - velocities # 根据力的总和更新鸟的速度 velocities += cohesion_factor * cohesion_force + separation_factor * separation_force + alignment_factor * alignment_force # 根据速度更新鸟的位置 positions += velocities # 限制速度不超过最大速度 velocities /= np.maximum(np.linalg.norm(velocities, axis=0), speed_limit) # 限制鸟的位置在模拟空间内 positions = np.clip(positions, 0, size) # 绘制鸟群的最终位置 plt.scatter(positions[0], positions[1]) plt.xlim(0, size) plt.ylim(0, size) plt.show() ``` 这个程序通过使用 NumPy 库来进行矩阵运算,使得计算效率更高。首先,我们初始化了鸟群的位置和速度,然后进行一系列的模拟步骤来更新每只鸟的位置和速度。在更新过程中,我们根据鸟与其他鸟的距离和速度之差来计算三个力,然后将这些力累加到鸟的速度上。最后,我们限制了鸟的速度不超过最大速度,并将鸟的位置限制在模拟空间内。最后,我们使用 matplotlib 库来绘制鸟群的最终位置。 希望这个程序对你有帮助!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值