<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=Bezier_Curve</id>
	<title>Bezier Curve - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=Bezier_Curve"/>
	<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Bezier_Curve&amp;action=history"/>
	<updated>2026-04-30T03:49:15Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=Bezier_Curve&amp;diff=1768&amp;oldid=prev</id>
		<title>Patarakin: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Bezier_Curve&amp;diff=1768&amp;oldid=prev"/>
		<updated>2022-07-21T08:33:16Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 11:33, 21 июля 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Patarakin</name></author>
	</entry>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=Bezier_Curve&amp;diff=1767&amp;oldid=prev</id>
		<title>scratch&gt;D over dx: Finally,</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=Bezier_Curve&amp;diff=1767&amp;oldid=prev"/>
		<updated>2022-07-04T18:12:41Z</updated>

		<summary type="html">&lt;p&gt;Finally,&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{stub|date=November 2019}}&lt;br /&gt;
A [[Wikipedia:Bézier curve|Bezier Curve]] is a smooth curve with many control points. It is infinitely scalable and often used in graphics and terrain generation. To make one in [[Scratch]], one must use the following two methods:&lt;br /&gt;
&lt;br /&gt;
==Method 1==&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
when green flag clicked&lt;br /&gt;
hide&lt;br /&gt;
pen up&lt;br /&gt;
set pen size to (2)&lt;br /&gt;
forever&lt;br /&gt;
  erase all&lt;br /&gt;
  def p-line :: custom&lt;br /&gt;
  set pen color to (#268435)&lt;br /&gt;
  draw p-line :: custom&lt;br /&gt;
  set pen color to (255)&lt;br /&gt;
  draw b-line steps: (90) :: custom&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
define set q-point A: (A.x :: custom-arg) (A.y :: custom-arg) B: (B.x :: custom-arg) (B.y :: custom-arg) progress: (progress :: custom-arg)&lt;br /&gt;
set [q.x v] to ((A.x :: custom-arg) + ((progress :: custom-arg) * ((B.x :: custom-arg) - (A.x :: custom-arg))))&lt;br /&gt;
set [q.y v] to ((A.y :: custom-arg) + ((progress :: custom-arg) * ((B.y :: custom-arg) - (A.y :: custom-arg))))&lt;br /&gt;
&lt;br /&gt;
define def p-line&lt;br /&gt;
delete all of [p.x v]&lt;br /&gt;
delete all of [p.y v]&lt;br /&gt;
add ([x position v] of [P.00 v]) to [p.x v] // These are all the controls points of the curve, using clones is another solution to this.&lt;br /&gt;
add ([y position v] of [P.00 v]) to [p.y v]&lt;br /&gt;
add ([x position v] of [P.01 v]) to [p.x v]&lt;br /&gt;
add ([y position v] of [P.01 v]) to [p.y v]&lt;br /&gt;
add ([x position v] of [P.02 v]) to [p.x v]&lt;br /&gt;
add ([y position v] of [P.02 v]) to [p.y v]&lt;br /&gt;
add ([x position v] of [P.03 v]) to [p.x v]&lt;br /&gt;
add ([y position v] of [P.03 v]) to [p.y v]&lt;br /&gt;
add ([x position v] of [P.04 v]) to [p.x v]&lt;br /&gt;
add ([y position v] of [P.04 v]) to [p.y v]&lt;br /&gt;
add ([x position v] of [P.05 v]) to [p.x v]&lt;br /&gt;
add ([y position v] of [P.05 v]) to [p.y v]&lt;br /&gt;
add ([x position v] of [P.06 v]) to [p.x v]&lt;br /&gt;
add ([y position v] of [P.06 v]) to [p.y v]&lt;br /&gt;
add ([x position v] of [P.07 v]) to [p.x v]&lt;br /&gt;
add ([y position v] of [P.07 v]) to [p.y v]&lt;br /&gt;
add ([x position v] of [P.08 v]) to [p.x v]&lt;br /&gt;
add ([y position v] of [P.08 v]) to [p.y v]&lt;br /&gt;
add ([x position v] of [P.09 v]) to [p.x v]&lt;br /&gt;
add ([y position v] of [P.09 v]) to [p.y v]&lt;br /&gt;
add ([x position v] of [P.10 v]) to [p.x v]&lt;br /&gt;
add ([y position v] of [P.10 v]) to [p.y v]&lt;br /&gt;
add ([x position v] of [P.11 v]) to [p.x v]&lt;br /&gt;
add ([y position v] of [P.11 v]) to [p.y v]&lt;br /&gt;
add ([x position v] of [P.12 v]) to [p.x v]&lt;br /&gt;
add ([y position v] of [P.12 v]) to [p.y v]&lt;br /&gt;
add ([x position v] of [P.13 v]) to [p.x v]&lt;br /&gt;
add ([y position v] of [P.13 v]) to [p.y v]&lt;br /&gt;
&lt;br /&gt;
define set b-point progress: (progress :: custom-arg)&lt;br /&gt;
delete all of [b.x v]&lt;br /&gt;
delete all of [b.y v]&lt;br /&gt;
repeat (length of [p.x v])&lt;br /&gt;
  add (item ((length of [b.x v]) + (1)) of [p.x v]) to [b.x v]&lt;br /&gt;
  add (item ((length of [b.y v]) + (1)) of [p.y v]) to [b.y v]&lt;br /&gt;
end&lt;br /&gt;
set [index.n v] to [1]&lt;br /&gt;
repeat ((length of [b.x v]) - (index.n))&lt;br /&gt;
  repeat ((length of [b.x v]) - (index.n))&lt;br /&gt;
    set q-point A: (item (index.n) of [b.x v]) (item (index.n) of [b.y v]) B: (item ((index.n) + (1)) of [b.x v]) (item ((index.n) + (1)) of [b.y v]) progress: (progress :: custom-arg) :: custom&lt;br /&gt;
    add (q.x) to [b.x v]&lt;br /&gt;
    add (q.y) to [b.y v]&lt;br /&gt;
    change [index.n v] by (1)&lt;br /&gt;
  end&lt;br /&gt;
  change [index.n v] by (1)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
define draw p-line&lt;br /&gt;
set [loop.n v] to [1]&lt;br /&gt;
go to x: (item (loop.n) of [p.x v]) y: (item (loop.n) of [p.y v])&lt;br /&gt;
pen down&lt;br /&gt;
repeat ((length of [p.x v]) - (loop.n))&lt;br /&gt;
  change [loop.n v] by (1)&lt;br /&gt;
  go to x: (item (loop.n) of [p.x v]) y: (item (loop.n) of [p.y v])&lt;br /&gt;
end&lt;br /&gt;
pen up&lt;br /&gt;
&lt;br /&gt;
define draw b-line steps: (steps :: custom-arg)&lt;br /&gt;
set [loop.n v] to [0]&lt;br /&gt;
set b-point progress: ((loop.n) / (steps :: custom-arg)) :: custom&lt;br /&gt;
go to x: (q.x) y: (q.y)&lt;br /&gt;
pen down&lt;br /&gt;
repeat ((steps :: custom-arg) - (loop.n))&lt;br /&gt;
  change [loop.n v] by (1)&lt;br /&gt;
  set b-point progress: ((loop.n) / (steps :: custom-arg)) :: custom&lt;br /&gt;
  go to x: (q.x) y: (q.y)&lt;br /&gt;
end&lt;br /&gt;
pen up&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
== Method 2 ==&lt;br /&gt;
One sprite needs this:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
When green flag clicked&lt;br /&gt;
hide&lt;br /&gt;
delete all of [clone x v]&lt;br /&gt;
delete all of [clone y v]&lt;br /&gt;
set drag mode [draggable v]&lt;br /&gt;
make clones :: custom&lt;br /&gt;
&lt;br /&gt;
define make clones&lt;br /&gt;
set [Clone ID v] to (1) //local variable&lt;br /&gt;
repeat (10)&lt;br /&gt;
  create clone of [myself v]&lt;br /&gt;
  add () to [clone x v]&lt;br /&gt;
  add () to [clone y v]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
When I start as a clone&lt;br /&gt;
show//make sure it has a costume&lt;br /&gt;
go to (random position v)&lt;br /&gt;
forever&lt;br /&gt;
  replace item (clone ID) of [clone x v] with (x position)&lt;br /&gt;
  replace item (clone ID) of [clone y v] with (y position)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another sprite, put this:&lt;br /&gt;
&amp;lt;scratchblocks&amp;gt;&lt;br /&gt;
When green flag clicked&lt;br /&gt;
forever&lt;br /&gt;
  erase all&lt;br /&gt;
  draw line between dots :: custom //without screen refresh&lt;br /&gt;
  Find curve points :: custom //without screen refresh&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
define copy main points&lt;br /&gt;
delete all of [x v]&lt;br /&gt;
delete all of [y v]&lt;br /&gt;
set [counter v] to (1)&lt;br /&gt;
repeat (length of [clone x v])&lt;br /&gt;
  add (item (counter) of [clone x v]) to [x v]&lt;br /&gt;
  add (item (counter) of [clone y v]) to [y v]&lt;br /&gt;
  change [counter v] by (1)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
define find curve points&lt;br /&gt;
delete all of [curve x v]&lt;br /&gt;
delete all of [curve y v]&lt;br /&gt;
set [t v] to (1)&lt;br /&gt;
repeat (100)&lt;br /&gt;
  copy main points :: custom&lt;br /&gt;
  repeat until &amp;lt;(length of [x v]) = (1)&amp;gt;&lt;br /&gt;
    find lines :: custom&lt;br /&gt;
  end&lt;br /&gt;
  add (x :: list) to [curve x v]&lt;br /&gt;
  add (y :: list) to [curve y v]&lt;br /&gt;
  change [t v] by (1)&lt;br /&gt;
end&lt;br /&gt;
Draw curve :: custom&lt;br /&gt;
&lt;br /&gt;
define move (t)% to x: (x) y: (y)&lt;br /&gt;
point in direction (([atan v] of (((x position)-(x))/((y position)-(y))))+((180)*&amp;lt;(y position)&amp;lt;(y)&amp;gt;))&lt;br /&gt;
move (([sqrt v] of ((((x position)-(x))*((x position)-(x)))+(((y position)-(y))*((y position)-(y)))))*((t)/(100))) steps&lt;br /&gt;
&lt;br /&gt;
define find lines&lt;br /&gt;
set [line counter v] to (1)&lt;br /&gt;
repeat ((length of [x v])-(1))&lt;br /&gt;
  go to x: (item (line counter) of [x v]) y: (item (line counter) of [y v])&lt;br /&gt;
  move (t)% to x: (item ((line counter)+(1)) of [x v]) y: (item ((line counter)+(1)) of [y v]) :: custom&lt;br /&gt;
  add (x position) to [x v]&lt;br /&gt;
  add (y position) to [y v]&lt;br /&gt;
  change [line counter v] by (1)&lt;br /&gt;
end&lt;br /&gt;
repeat ((line counter)-(1))&lt;br /&gt;
  delete (1) of [x v]&lt;br /&gt;
  delete (1) of [y v]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
define Draw curve&lt;br /&gt;
go to x: (item (1) of [curve x v]) y: (item (1) of [curve y v])&lt;br /&gt;
pen down&lt;br /&gt;
set [line counter v] to (1)&lt;br /&gt;
repeat (length of [curve x v])&lt;br /&gt;
  go to x: (item (line counter) of [curve x v]) y: (item (line counter) of [curve y v])&lt;br /&gt;
  change [line counter v] by (1)&lt;br /&gt;
end&lt;br /&gt;
pen up&lt;br /&gt;
&lt;br /&gt;
define draw line between dots&lt;br /&gt;
go to x: (item (1) of [clone x v]) y: (item (1) of [clone y v])&lt;br /&gt;
pen down&lt;br /&gt;
set [line counter v] to (1)&lt;br /&gt;
repeat (length of [clone x v])&lt;br /&gt;
  go to x: (item (line counter) of [clone x v]) y: (item (line counter) of [clone y v])&lt;br /&gt;
  change [line counter v] by (1)&lt;br /&gt;
end&lt;br /&gt;
pen up&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/scratchblocks&amp;gt;&lt;br /&gt;
[[projects:481981600/fullscreen|Example located here]]&lt;br /&gt;
&lt;br /&gt;
== Uses of Bezier Curves ==&lt;br /&gt;
There are many uses of Bezier curves within Scratch. These can include:&lt;br /&gt;
* Combining them with [[velocity]] to make things fall or bounce.&lt;br /&gt;
* Rendering a terrain with hills so that when one zooms in, the curve still looks nice.&lt;br /&gt;
* Making customisable graphs.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Velocity]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting Tutorials]][[Category:Math Tutorials]]&lt;/div&gt;</summary>
		<author><name>scratch&gt;D over dx</name></author>
	</entry>
</feed>