<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>EDGE()테스트 by Mankyu Sung</title>
      <link>https://padlet.com/mksung89/edge</link>
      <description></description>
      <language>en-us</language>
      <pubDate>2022-10-17 01:42:35 UTC</pubDate>
      <lastBuildDate>2026-01-05 04:42:06 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>5533510 정창교</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342381983</link>
         <description><![CDATA[<div><br>#include&lt;iostream&gt;<br>#include&lt;glm/glm.hpp&gt; // glm 모든기능 포함<br>//#include&lt;glm/vec2.hpp&gt; 일부기능만 가져오기<br>#include &lt;glm/gtx/string_cast.hpp&gt; // 출력하기위해<br>//using namespace glm;<br>#include&lt;glm/gtx/transform.hpp&gt;<br><br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br><br>#define GLM_FORCE_SWIZZLE<br><br>const double DEGREES_TO_RADIANS = glm::pi&lt;float&gt;() / 180.0;<br>const double RADIANS_TO_DEGREES = 180.0 / glm::pi&lt;float&gt;();<br><br><br>#include &lt;glm/mat4x4.hpp&gt;<br><br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c) {<br>	return ((c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x));<br>}<br><br><br>int main() {<br><br>	glm::vec2 v2 = { 0.3,-0.6 };<br>	glm::vec2 v1 = {0,0.7 };<br>	glm::vec2 v0 = { -0.3,-0.6 };<br>	glm::vec2 point1 = { 50,50 };<br>	glm::vec2 point2 = { 90,50 };<br><br><br>	//screen --&gt; ndc<br>	glm::vec2 p0,p1,p2;<br>	p0.x = (v0.x + 1) / 2;<br>	p0.y = (1 - v0.y) / 2;<br>	p1.x = (v1.x + 1) / 2;<br>	p1.y = (1 - v1.y) / 2;<br>	p2.x = (v2.x + 1) / 2;<br>	p2.y = (1 - v2.y) / 2;<br><br>	glm::ivec2 p0raster,p1raster,p2raster;<br><br>	//ndc --&gt; raster<br>	p0raster.x = (int)(p0.x * 100);<br>	p0raster.y = (int)(p0.y * 100);<br>	p1raster.x = (int)(p1.x * 100);<br>	p1raster.y = (int)(p1.y * 100);<br>	p2raster.x = (int)(p2.x * 100);<br>	p2raster.y = (int)(p2.y * 100);<br><br>	if (p0raster.x == 100) p0raster.x = 100 - 1;<br>	if (p0raster.y == 100) p0raster.y = 100 - 1;<br>	if (p1raster.x == 100) p1raster.x = 100 - 1;<br>	if (p1raster.y == 100) p1raster.y = 100 - 1;<br>	if (p2raster.x == 100) p2raster.x = 100 - 1;<br>	if (p2raster.y == 100) p2raster.y = 100 - 1;<br>		<br>	float pw0 = edgeFunction(p0raster, p2raster, point1);<br>	float pw1 = edgeFunction(p2raster, p1raster, point1);<br>	float pw2 = edgeFunction(p1raster, p0raster, point1);<br><br>	std::cout &lt;&lt; "p1에 대한 edgefunction 값" &lt;&lt; std::endl;<br>	std::cout &lt;&lt; pw0 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; pw1 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; pw2 &lt;&lt; std::endl;<br>	<br>	bool inside;<br>	if (pw0 &gt; 0 &amp;&amp; pw1 &gt; 0 &amp;&amp; pw2 &gt; 0) inside = true;<br>	else inside = false;<br>	std::cout &lt;&lt; "{50,50}이 안에 있는가" &lt;&lt; (inside == 1 ? "true" : "false") &lt;&lt; std::endl;<br>	<br><br>	float w0 = edgeFunction(p0raster, p2raster, point2);<br>	float w1 = edgeFunction(p2raster, p1raster, point2);<br>	float w2 = edgeFunction(p1raster, p0raster, point2);<br><br>	std::cout &lt;&lt; "p2에 대한 edgefunction 값" &lt;&lt; std::endl;<br>	std::cout &lt;&lt; w0 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; w1 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; w2 &lt;&lt; std::endl;<br><br>	if (w0 &gt; 0 &amp;&amp; w1 &gt; 0 &amp;&amp; w2 &gt; 0) inside = true;<br>	else inside = false;<br>	std::cout &lt;&lt; "{90,50}이 안에 있는가" &lt;&lt; (inside==1?"true" : "false") &lt;&lt; std::endl;<br><br><br>	return 0;<br>}<br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1621877611/f80e339b573acf6cdb537c35537205cf/image.png" />
         <pubDate>2022-10-17 02:15:53 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342381983</guid>
      </item>
      <item>
         <title>5415279 황찬일</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342383948</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br><br>float edgeFunction(const glm::vec3&amp; v0, const glm::vec3&amp; v1, const glm::vec2&amp; p)<br>{<br>	return (p.x - v0.x) * (v1.y - v0.x) - (p.y - v0.y) * (v1.x - v0.x);<br>}<br><br>glm::vec2 screen2NDC(const glm::vec2&amp; screen)<br>{<br>	glm::vec2 result;<br>	result.x = (screen.x + 1) / 2;<br>	result.y = (1 - screen.y) / 2;<br>	return result;<br>}<br><br>glm::vec3 NDC2raster(const glm::vec2&amp; NDC, int width, int height)<br>{<br>	glm::vec3 result;<br>	result.x = (int)(NDC.x * width);<br>	result.y = (int)(NDC.y * height);<br>	result.z = 1; // no cam point<br><br>	if (result.x == width)<br>		result.x = width - 1;<br>	if (result.y == height)<br>		result.y = height - 1;<br>	return result;<br>}<br><br>int main()<br>{<br>	int width = 100, height = 100;<br>	float l = -1, r = 1, b = 1, t = -1;<br><br>	//screen space<br>	glm::vec2 screen_p[3] = { glm::vec2(-0.3, -0.6), glm::vec2(0, 0.7), glm::vec2(0.3, -0.6) };<br><br>	//screen to NDC<br>	glm::vec2 NDC_p[3];<br>	for (int i = 0; i &lt; 3; i++)<br>		NDC_p[i] = screen2NDC(screen_p[i]);<br><br>	//NDC to raster<br>	glm::vec3 raster_p[3];<br>	for (int i = 0; i &lt; 3; i++)<br>		raster_p[i] = NDC2raster(NDC_p[i], width, height);<br><br>	//testing point on raster space<br>	glm::vec2 p1(50, 50), p2(90, 50);<br><br>	//test1<br>	bool inside = true;<br>	for (int i = 0; i &lt; 3; i++)<br>	{<br>		if (edgeFunction(raster_p[i % 3], raster_p[(i + 2) % 3], p1) &lt; 0) {<br>			inside = false;<br>			break;<br>		}<br>	}<br>	std::cout &lt;&lt; "P(50,50) : " &lt;&lt; (inside ? "true" : "false") &lt;&lt; std::endl;<br>	//test2<br>	inside = true;<br>	for (int i = 0; i &lt; 3; i++)<br>	{<br>		if (edgeFunction(raster_p[i % 3], raster_p[(i + 2) % 3], p2) &lt; 0) {<br>			inside = false;<br>			break;<br>		}<br>	}<br>	std::cout &lt;&lt; "P(90,50) : " &lt;&lt; (inside ? "true" : "false") &lt;&lt; std::endl;<br><br><br>	return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1640981467/4c62cc7a6c69b71716824843151aca0a/__.PNG" />
         <pubDate>2022-10-17 02:17:27 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342383948</guid>
      </item>
      <item>
         <title>5415174 장승국</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342383996</link>
         <description><![CDATA[<div>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp &gt;<br>#include &lt;iostream&gt;<br><br>#define IMG_WIDTH 100<br>#define IMG_HEIGHT 100<br><br>float edgeFunction(const glm::vec3&amp; a,const glm::vec3&amp; b, const glm::vec3&amp; c)<br>{<br>&nbsp; return (c[0] - a[0]) * (b[1] - a[1]) - (c[1] - a[1]) * (b[0] - a[0]);<br>}<br>glm::vec3 ScreenToNDC(glm::vec3 a)<br>{<br>&nbsp; return glm::vec3((a.x + 1.f) * 0.5f, (1.f - a.y) * 0.5f, 1);<br>}<br><br>glm::vec3 NDC_To_Raster(glm::vec3 a, int width, int height)<br>{<br>&nbsp; glm::vec3 Raster_a(glm::vec3((int)(a.x * width), (int)(a.y * height), 1));<br>&nbsp; if (Raster_a.x == width)<br>&nbsp; &nbsp; Raster_a.x = width - 1;<br>&nbsp; if (Raster_a.y == height)<br>&nbsp; &nbsp; Raster_a.y = height - 1;<br>&nbsp; return Raster_a;<br>}<br>glm::vec3 ScreenToRaster(glm::vec3 a, int width, int height)<br>{<br>&nbsp; glm::vec3 ndc_a = ScreenToNDC(a);<br>&nbsp; return NDC_To_Raster(ndc_a, width, height);<br>}<br>bool IsInside(glm::vec3 v0, glm::vec3 v1, glm::vec3 v2, glm::vec3 p)<br>{<br>&nbsp; float w0 = edgeFunction(v1, v2, p);<br>&nbsp; float w1 = edgeFunction(v2, v0, p);<br>&nbsp; float w2 = edgeFunction(v0, v1, p);<br><br>&nbsp; bool inside = true;<br><br>&nbsp; glm::vec3 edge0 = v2 - v1;<br>&nbsp; glm::vec3 edge1 = v0 - v2;<br>&nbsp; glm::vec3 edge2 = v1 - v0;<br><br>&nbsp; bool overlaps = true;<br><br>&nbsp; return overlaps &amp;= (w0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (w0 &gt; 0));<br>}<br>int main()<br>{<br>&nbsp; glm::vec3 v0(-0.3, -0.6, 1);<br>&nbsp; glm::vec3 v2(0, 0.7, 1);<br>&nbsp; glm::vec3 v1(0.3, -0.6, 1);<br>&nbsp; glm::vec3 p1(50, 50, 1);<br>&nbsp; glm::vec3 p2(90, 50, 1);<br><br>&nbsp; glm::vec3 v_0 = ScreenToRaster(v0, IMG_WIDTH, IMG_HEIGHT);<br>&nbsp; glm::vec3 v_1 = ScreenToRaster(v1, IMG_WIDTH, IMG_HEIGHT);<br>&nbsp; glm::vec3 v_2 = ScreenToRaster(v2, IMG_WIDTH, IMG_HEIGHT);<br><br>&nbsp; std::cout &lt;&lt; "v'0 : " &lt;&lt; glm::to_string(v_0) &lt;&lt; std::endl;<br>&nbsp; std::cout &lt;&lt; "v'1 : " &lt;&lt; glm::to_string(v_1) &lt;&lt; std::endl;<br>&nbsp; std::cout &lt;&lt; "v'2 : " &lt;&lt; glm::to_string(v_2) &lt;&lt; std::endl;<br><br>&nbsp; std::cout &lt;&lt; "p1 is inside? : " &lt;&lt; IsInside(v_0, v_1, v_2, p1) &lt;&lt; std::endl;<br>&nbsp; std::cout &lt;&lt; "p2 is inside? : " &lt;&lt; IsInside(v_0, v_1, v_2, p2) &lt;&lt; std::endl;<br>&nbsp; return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796480394/036ef7f972b509bb524a45ef322b2d88/inside.PNG" />
         <pubDate>2022-10-17 02:17:30 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342383996</guid>
      </item>
      <item>
         <title>5555726 안주환</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342384341</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br><br>bool edgeFunction(const glm::vec2 &amp;a, const glm::vec2 &amp;b, const glm::vec2 &amp;c) {<br>	return ((c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x) &gt;= 0);<br>}<br><br>int main()<br>{<br>	int width = 100;<br>	int height = 100;<br><br>	glm::vec2 v0(-0.3, -0.6);<br>	glm::vec2 v1(0, 0.7);<br>	glm::vec2 v2(0.3, -0.6);<br>	glm::vec2 p1(50, 50);<br>	glm::vec2 p2(90, 50);<br><br>	glm::vec2 v0Ndc;<br>	glm::vec2 v1Ndc;<br>	glm::vec2 v2Ndc;<br><br><br>	v0Ndc.x = (v0.x + 1) / 2;<br>	v0Ndc.y = (1 - v0.y) / 2;<br>	v1Ndc.x = (v1.x + 1) / 2;<br>	v1Ndc.y = (1 - v1.y) / 2;<br>	v2Ndc.x = (v2.x + 1) / 2;<br>	v2Ndc.y = (1 - v2.y) / 2;<br><br>	glm::vec2 v0Ras;<br>	glm::vec2 v1Ras;<br>	glm::vec2 v2Ras;<br><br><br><br>	v0Ras.x = (int)(v0Ndc.x * width);<br>	v0Ras.y = (int)(v0Ndc.x * height);<br>	v1Ras.x = (int)(v1Ndc.x * width);<br>	v1Ras.y = (int)(v1Ndc.x * height);<br>	v2Ras.x = (int)(v2Ndc.x * width);<br>	v2Ras.y = (int)(v2Ndc.x * height);<br><br>	if (v0Ras.x == width) v0Ras.x = width - 1;<br>	if (v0Ras.y == height) v0Ras.y = width - 1;<br>	if (v1Ras.x == width) v1Ras.x = width - 1;<br>	if (v1Ras.y == height) v1Ras.y = width - 1;<br>	if (v2Ras.x == width) v2Ras.x = width - 1;<br>	if (v2Ras.y == height) v2Ras.y = width - 1;<br><br><br><br>	bool w0 = edgeFunction(v1Ras, v2Ras, p1);<br>	bool w1 = edgeFunction(v2Ras, v0Ras, p1);<br>	bool w2 = edgeFunction(v0Ras, v1Ras, p1);<br>	bool _w0 = edgeFunction(v1Ras, v2Ras, p2);<br>	bool _w1 = edgeFunction(v2Ras, v0Ras, p2);<br>	bool _w2 = edgeFunction(v0Ras, v1Ras, p2);<br><br>	glm::vec2 edge0 = v2Ras - v1Ras;<br>	glm::vec2 edge1 = v0Ras - v2Ras;<br>	glm::vec2 edge2 = v1Ras - v0Ras;<br><br>	bool isP1 = true;<br>	bool isP2 = true;<br><br>	if (w0 == true &amp;&amp; w1 == true &amp;&amp; w2 == true)<br>		isP1 = true;<br>	else<br>		isP1 = false;<br><br>	if (_w0 == true &amp;&amp; _w1 == true &amp;&amp; _w2 == true)<br>		isP2 = true;<br>	else<br>		isP2 = false;<br><br>	if (isP1)<br>		std::cout &lt;&lt; "p1 is inside" &lt;&lt; std::endl;<br>	else if(!isP1)<br>		std::cout &lt;&lt; "p1 is outside" &lt;&lt; std::endl;<br><br>	if (isP2)<br>		std::cout &lt;&lt; "p2 is inside" &lt;&lt; std::endl;<br>	else if (!isP2)<br>		std::cout &lt;&lt; "p2 is outside" &lt;&lt; std::endl;<br><br><br><br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796486516/5c9f0432630c06d1f28179e6d02965f3/image.png" />
         <pubDate>2022-10-17 02:17:47 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342384341</guid>
      </item>
      <item>
         <title>5470511 한재민</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342387836</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include &lt;glm/gtc/constants.hpp&gt;<br>#define GLM_FORCE_SWIZZLE<br>const double DEGREES_TO_RADIAS = glm::pi&lt;float&gt;() / 180.0;<br>const double RADIANS_TO_DEGREES = 180.0 / glm::pi&lt;float&gt;();<br>#define Wighth 100<br>#define Herght 100<br><br>using namespace glm;<br>using namespace std;<br><br>vec2 normallized_(vec2&amp; x)<br>{<br>	x.x = (x.x + 1) / 2;<br>	x.y = (x.y + 1) / 2;<br>	return x;<br>}<br><br>vec2 rester_space(vec2&amp; x)<br>{<br>	x.x = x.x * Wighth;<br>	x.y = -1 * x.y * Herght;<br>	return x;<br>}<br><br>bool edgeFunction(vec2 a, vec2 b, vec2 c)<br>{<br>	if(a.y &gt;= 0)<br>		return ((c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x) &gt;= 0);<br>	else<br>		return (-(c.x - a.x) * (b.y - a.y) + (-c.y - a.y) * (b.x - a.x) &gt;= 0);<br>}<br><br><br>int main()<br>{<br>	vec2 p1 = { 50,50 };<br>	vec2 p2 = { 90,50 };<br><br>	vec2 v0 = { -0.3f, -0.6f };<br>	vec2 v1 = { 0, 0.7f };<br>	vec2 v2 = { 0.3f, -0.6f };<br><br>	v0 = normallized_(v0);<br>	v1 = normallized_(v1);<br>	v2 = normallized_(v2);<br><br>	v0 = rester_space(v0);<br>	v1 = rester_space(v1);<br>	v2 = rester_space(v2);<br><br>	cout &lt;&lt; "v0[" &lt;&lt; v0.x &lt;&lt; ", " &lt;&lt; v0.y &lt;&lt; "], v1[" &lt;&lt; v1.x &lt;&lt; ", " &lt;&lt; v1.y &lt;&lt; "], v2[" &lt;&lt; v2.x &lt;&lt; ", " &lt;&lt; v2.y &lt;&lt; "]" "\n ";<br><br>	float w0 = edgeFunction(v1, v2, p1);<br>	float w1 = edgeFunction(v2, v0, p1);<br>	float w2 = edgeFunction(v0, v1, p1);<br><br>	float w0_ = edgeFunction(v1, v2, p2);<br>	float w1_ = edgeFunction(v2, v0, p2);<br>	float w2_ = edgeFunction(v0, v1, p2);<br><br>	vec2 edge0 = v2 - v1;&nbsp;<br>	vec2 edge1 = v0 - v2;<br>	vec2 edge2 = v1 - v0;<br><br>	bool overlaps = true;<br>	bool overlaps_ = true;<br>	<br>	// 포인트가 edge 상에 있는지, 오른쪽 왼쪽인지 테스트,&nbsp;<br>	<br>	cout &lt;&lt; "" &lt;&lt; w0 &lt;&lt; ", " &lt;&lt; w1 &lt;&lt; ", " &lt;&lt; w2 &lt;&lt; "\n ";<br>	cout &lt;&lt; "" &lt;&lt; w0_ &lt;&lt; ", " &lt;&lt; w1_ &lt;&lt; ", " &lt;&lt; w2_ &lt;&lt; "\n ";<br><br>	overlaps &amp;= (w0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (w0 &gt; 0));<br>	overlaps &amp;= (w1 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (w1 &gt; 0));<br>	overlaps &amp;= (w1 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (w2 &gt; 0));<br><br>	overlaps_ &amp;= (w0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (w0_ &gt; 0));<br>	overlaps_ &amp;= (w1 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (w1_ &gt; 0));<br>	overlaps_ &amp;= (w1 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (w2_ &gt; 0));<br><br>	cout &lt;&lt; "점 P1의 위치: [ " &lt;&lt; overlaps &lt;&lt; " ]\n";<br>	cout &lt;&lt; "점 P2의 위치: [ " &lt;&lt; overlaps_ &lt;&lt; " ]\n\n(1이면 true, 0이면 false)\n";<br>	<br>	return 0;<br>}<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796493695/6fff6046157bcf23b63036166b7caec5/image.png" />
         <pubDate>2022-10-17 02:19:47 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342387836</guid>
      </item>
      <item>
         <title>5415191 조소연</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342402039</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp &gt;&nbsp;<br>float edgeFunction(const glm::vec3&amp; a, const glm::vec3&amp; b, const glm::vec3&amp; c)<br>{<br>	return ((c.x - a.x) * (b.y- a.y) - (c.y - a.y) * (b.x - a.x));<br>}<br>bool InsideCheck(const glm::vec3&amp; a, const glm::vec3&amp; b, const glm::vec3&amp; c, const glm::vec3&amp; p)<br>{<br>	float overlaps[3]; // must be same direction<br>	overlaps[0] = edgeFunction(a,c, p);<br>	overlaps[1] = edgeFunction(c,b,p);<br>	overlaps[2] = edgeFunction(b,a,p);<br><br>	std::cout &lt;&lt; overlaps[0] &lt;&lt; std::endl;<br>	std::cout &lt;&lt; overlaps[1] &lt;&lt; std::endl;<br>	std::cout &lt;&lt; overlaps[2] &lt;&lt; std::endl;<br><br>	bool isIn=true;<br>	for (int i = 0; i &lt; 3; )<br>	{<br>		if (overlaps[i] &gt;= 0 &amp;&amp; isIn)<br>		{<br>			isIn = true;<br>			i++;<br>		}<br>		else<br>			return false;<br>	}&nbsp;<br><br>	return isIn;<br>}<br><br>int main()<br>{<br><br>	glm::vec2 imageSize = { 100,100 };<br>	//screen<br><br>	glm::vec2 v[3];<br>	v[0] = {-0.3, -0.6};<br>	v[1] = { 0, 0.7 };<br>	v[2] = { 0.3, -0.6};<br><br><br><br>	glm::vec2 pNDCv[3];<br>	for (int i = 0; i &lt; 3; i++)<br>	{<br>		pNDCv[i].x = ( v[i].x + 1 ) / 2;<br>		pNDCv[i].y = (1 - v[i].y) / 2;<br>	}<br><br><br>	//Raster // must be int<br>	glm::vec3 pRaster[3];<br>	for (int i = 0; i &lt; 3; i++)<br>	{<br>		pRaster[i].x =(int)(pNDCv[i].x* imageSize.x);<br>		pRaster[i].y =&nbsp; (int)(pNDCv[i].y * imageSize.y); // height. make upsidedown<br>		pRaster[i].z = 1;<br><br>		if (pRaster[i].x == imageSize.x)<br>			pRaster[i].x -= 1;<br><br>		if (pRaster[i].y == imageSize.y)<br>			pRaster[i].y -= 1;<br>	}<br><br><br>	//insideout check<br><br>	glm::vec3 p1 = { 50,50,1 };<br>	glm::vec3 p2 = { 90,50,1 };<br><br><br><br><br>	for (int i = 0; i &lt; 3; i++)<br>	{<br>		std::cout &lt;&lt; "in Sreen v" &lt;&lt; i &lt;&lt; " : " &lt;&lt; glm::to_string(v[i]) &lt;&lt; std::endl;<br>	}<br>	for (int i = 0; i &lt; 3; i++)<br>	{<br>		std::cout &lt;&lt; "in NDC v" &lt;&lt; i &lt;&lt; " : " &lt;&lt; glm::to_string(pNDCv[i]) &lt;&lt; std::endl;<br>	}<br>	for (int i = 0; i &lt; 3; i++)<br>	{<br>		std::cout &lt;&lt; "in raster v" &lt;&lt; i &lt;&lt; " : " &lt;&lt; glm::to_string(pRaster[i]) &lt;&lt; std::endl;<br>	}<br>	std::cout &lt;&lt; "p1 is inside? : " &lt;&lt; InsideCheck(pRaster[0], pRaster[1], pRaster[2],p1) &lt;&lt; std::endl;<br>	std::cout &lt;&lt; "p2 is inside? : " &lt;&lt; InsideCheck(pRaster[0], pRaster[1], pRaster[2], p2) &lt;&lt; std::endl;<br><br><br><br>	return 0;<br>}<br><br><br>//NDC<br>//glm::vec2 pNDCv[3];<br>//float l = -0.3;<br>//float r = 0.3;<br>//float t = 0.7;<br>//float b = -0.6;<br><br>//pNDCv[i].x = 2 * v[i].x / (r - l) - (r + l) / (r - l);<br>//pNDCv[i].y = 2 * v[i].x / (t - b) - (t + b) / (t - b);<br>//&nbsp;<br>	//float overlaps2[3]; // counterClockwise<br>	//overlaps2[0] = edgeFunction(pRaster[0], pRaster[2], p2);<br>	//overlaps2[1] = edgeFunction(pRaster[2], pRaster[1], p2);<br>	//overlaps2[2] = edgeFunction(pRaster[1], pRaster[0], p2);<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796477282/56f367493c67922ea06e143da7a5f2ed/image.png" />
         <pubDate>2022-10-17 02:31:25 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342402039</guid>
      </item>
      <item>
         <title>5533585 최정욱</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342402760</link>
         <description><![CDATA[<div><br>#include&lt;iostream&gt;<br>#include&lt;glm/glm.hpp&gt;<br>#include&lt;glm/gtx/string_cast.hpp&gt;<br>#include&lt;glm/matrix.hpp&gt;<br>#include&lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>float edgeFunction(const glm::vec3&amp; a, const glm::vec3&amp; b, const glm::vec3&amp; c);<br>int main() {	<br>        glm::vec3 v0(-0.3,-0.6,0);<br>	glm::vec3 v1(0,0.7,0);<br>	glm::vec3 v2(0.3,-0.6,0);<br>	glm::vec3 p1(50,50,0);<br>	glm::vec3 p2(90,50,0);<br><br>	v0.x = ((v0.x + 1) / 2) * 100;<br>	v0.y = ((1 - v0.y)/2)*100;<br>	v1.x = ((v1.x + 1) / 2) * 100;<br>	v1.y = ((1 - v1.y) / 2) * 100;<br>	v2.x = ((v2.x + 1) / 2) * 100;<br>	v2.y = ((1 - v2.y) / 2) * 100;<br><br>	<br><br>	float w0 = edgeFunction(v0, v1, p1);<br>	float w1 = edgeFunction(v1, v2, p1);<br>	float w2 = edgeFunction(v2, v0, p1);<br>	std::cout &lt;&lt; w0 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; w1 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; w2 &lt;&lt; std::endl;<br><br>	if (w0 &gt; 0 &amp;&amp; w1 &gt; 0 &amp;&amp; w2 &gt; 0) {<br>		std::cout &lt;&lt;"p1은 삼각형 내부에 존재함." &lt;&lt; std::endl;<br>	}<br>	else {<br>		std::cout &lt;&lt; "p1은 삼각형 외부에 존재함." &lt;&lt; std::endl;<br>	}<br><br>	float z0 = edgeFunction(v0, v1, p2);<br>	float z1 = edgeFunction(v1, v2, p2);<br>	float z2 = edgeFunction(v2, v0, p2);<br><br>	std::cout &lt;&lt; z0 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; z1 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; z2 &lt;&lt; std::endl;<br><br>	if (z0 &gt; 0 &amp;&amp; z1 &gt; 0 &amp;&amp; z2 &gt; 0) {<br>		std::cout &lt;&lt; "p2은 삼각형 내부에 존재함." &lt;&lt; std::endl;<br>	}<br>	else {<br>		std::cout &lt;&lt; "p2은 삼각형 외부에 존재함." &lt;&lt; std::endl;<br>	}<br><br>}<br><br>float edgeFunction(const glm::vec3&amp; a, const glm::vec3&amp; b, const glm::vec3&amp; c)<br>{<br><br>	return(c[0] - a[0])* (a[1] - b[1]) - (a[1] - c[1]) * (b[0] - a[0]);<br><br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796480937/d6abd0eaab2a2adfea147f23c310c25a/______2022_10_17_112909.png" />
         <pubDate>2022-10-17 02:32:05 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342402760</guid>
      </item>
      <item>
         <title>5533190 권구호</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342405118</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br><br>using namespace std;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c) {<br>	return { (c[0] - a[0]) * (b[1] - a[1]) - (c[1] - a[1]) * (b[0] - a[0]) };<br>}<br>int main() {<br>	int width = 100;<br>	int height = 100;<br><br>	glm::vec2 v0(-0.3, -0.6);<br>	glm::vec2 v1(0, 0.7);<br>	glm::vec2 v2(0.3, -0.6);<br><br>	glm::vec2 v0NDC = { (v0.x + 1) / 2, (1 - v0.y) / 2 };<br>	glm::vec2 v1NDC = { (v1.x + 1) / 2, (1 - v1.y) / 2 };<br>	glm::vec2 v2NDC = { (v2.x + 1) / 2, (1 - v2.y) / 2 };<br><br>	glm::ivec2 v0Raster = { (int)((v0NDC.x) * width), (int)((v0NDC.y) * height) };<br>	glm::ivec2 v1Raster = { (int)((v1NDC.x) * width), (int)((v1NDC.y) * height) };<br>	glm::ivec2 v2Raster = { (int)((v2NDC.x) * width), (int)((v2NDC.y) * height) };<br><br>	glm::vec2 p1(50, 50);<br>	glm::vec2 p2(90, 50);<br><br>	cout &lt;&lt; "P1(50, 50)에 대해 inside/outside 테스트" &lt;&lt; endl;<br>	cout &lt;&lt; "edge(v0, v1, p1): " &lt;&lt; edgeFunction(v1Raster, v0Raster, p1) &lt;&lt; endl;<br>	cout &lt;&lt; "edge(v1, v2, p1): " &lt;&lt; edgeFunction(v2Raster, v1Raster, p1) &lt;&lt; endl;<br>	cout &lt;&lt; "edge(v2, v0, p1): " &lt;&lt; edgeFunction(v0Raster, v2Raster, p1) &lt;&lt; endl;<br>	if (edgeFunction(v1Raster, v0Raster, p1) &gt;= 0 &amp;&amp; edgeFunction(v2Raster, v1Raster, p1) &gt;= 0 &amp;&amp; edgeFunction(v0Raster, v2Raster, p1) &gt;= 0) {<br>		cout &lt;&lt; "inside"&lt;&lt;endl;<br>	}<br>	else<br>	{<br>		cout &lt;&lt; "outside" &lt;&lt; endl;<br>	}<br>	cout &lt;&lt; "P2(90, 50)에 대해 inside/outside 테스트" &lt;&lt; endl;<br>	cout &lt;&lt; "edge(v0, v1, p2): " &lt;&lt; edgeFunction(v1Raster, v0Raster, p2) &lt;&lt; endl;<br>	cout &lt;&lt; "edge(v1, v2, p2): " &lt;&lt; edgeFunction(v2Raster, v1Raster, p2) &lt;&lt; endl;<br>	cout &lt;&lt; "edge(v2, v0, p2): " &lt;&lt; edgeFunction(v0Raster, v2Raster, p2) &lt;&lt; endl;<br>	if (edgeFunction(v1Raster, v0Raster, p2) &gt;= 0 &amp;&amp; edgeFunction(v2Raster, v1Raster, p2) &gt;= 0 &amp;&amp; edgeFunction(v0Raster, v2Raster, p2) &gt;= 0) {<br>		cout &lt;&lt; "inside" &lt;&lt; endl;<br>	}<br>	else<br>	{<br>		cout &lt;&lt; "outside" &lt;&lt; endl;<br>	}<br>	return 0;<br>}<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796490277/a07a705bebdc38da0a5b1293c5e93612/image.png" />
         <pubDate>2022-10-17 02:34:17 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342405118</guid>
      </item>
      <item>
         <title>5533767 양준석</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342409546</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br><br><br>#define GLM_FORCE_SWIZZLE // Swizzle operator ex) B.yx = A.wy; B = A.xx;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>&nbsp; &nbsp; &nbsp; &nbsp; return (c[0] - a[0]) * (a[1] - b[1]) - (a[1] - c[1]) * (b[0] - a[0]);<br>}<br><br>int main()<br>{<br>&nbsp; &nbsp; glm::vec2 p1(50, 50);<br>&nbsp; &nbsp; glm::vec2 p2(90, 50);<br><br>&nbsp; &nbsp; glm::vec2 v0 = { -0.3,-0.6 };<br>&nbsp; &nbsp; glm::vec2 v1 = { 0,0.7 };<br>&nbsp; &nbsp; glm::vec2 v2 = { 0.3,-0.6 };<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; v0.x = ((v0.x + 1) / 2) * 100;<br>&nbsp; &nbsp; v0.y = ((1 - v0.y) / 2) * 100;<br>&nbsp; &nbsp; v1.x = ((v1.x + 1) / 2) * 100;<br>&nbsp; &nbsp; v1.y = ((1 - v1.y) / 2) * 100;<br>&nbsp; &nbsp; v2.x = ((v2.x + 1) / 2) * 100;<br>&nbsp; &nbsp; v2.y = ((1 - v2.y) / 2) * 100;<br><br><br>&nbsp; &nbsp; float p2_w0 = edgeFunction(v1, v2, p2);<br>&nbsp; &nbsp; float p2_w1 = edgeFunction(v2, v0, p2);<br>&nbsp; &nbsp; float p2_w2 = edgeFunction(v0, v1, p2);<br><br>&nbsp; &nbsp; float p1_w0 = edgeFunction(v1, v2, p1);<br>&nbsp; &nbsp; float p1_w1 = edgeFunction(v2, v0, p1);<br>&nbsp; &nbsp; float p1_w2 = edgeFunction(v0, v1, p1);<br><br>&nbsp; &nbsp; glm::vec2 edge0 = v2 - v1;<br>&nbsp; &nbsp; glm::vec2 edge1 = v0 - v2;<br>&nbsp; &nbsp; glm::vec2 edge2 = v1 - v0;<br><br><br>&nbsp; &nbsp; bool inside_p1 = true;<br>&nbsp; &nbsp; bool inside_p2 = true;<br><br>&nbsp; &nbsp; inside_p1 &amp;= (p1_w0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (p1_w0 &gt; 0));<br>&nbsp; &nbsp; inside_p1 &amp;= (p1_w1 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (p1_w1 &gt; 0));<br>&nbsp; &nbsp; inside_p1 &amp;= (p1_w1 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (p1_w2 &gt; 0));<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; inside_p2 &amp;= (p2_w0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (p2_w0 &gt; 0));<br>&nbsp; &nbsp; inside_p2 &amp;= (p2_w1 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (p2_w1 &gt; 0));<br>&nbsp; &nbsp; inside_p2 &amp;= (p2_w1 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (p2_w2 &gt; 0));<br><br>&nbsp; &nbsp; std::cout &lt;&lt; "(50,50) inside: " &lt;&lt; std::boolalpha &lt;&lt; inside_p1 &lt;&lt; std::endl;<br><br>&nbsp; &nbsp; std::cout &lt;&lt; "(90,50) inside: " &lt;&lt; std::boolalpha &lt;&lt; inside_p2 &lt;&lt; std::endl;<br>&nbsp; &nbsp; return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796494359/f9baa4bed621f2e2396f2cdb63eae337/image.png" />
         <pubDate>2022-10-17 02:38:14 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342409546</guid>
      </item>
      <item>
         <title>5533220 김대연</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342411448</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/vec2.hpp&gt;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	return&nbsp; ((c.x - a.x)* (b.y - a.y) - (c.y - a.y) * (b.x - a.x));<br>}<br><br>int main()<br>{<br>	float width, height;<br>	<br>	width = 100.0f;<br>	height = 100.0f;<br><br>	glm::vec2 v0(-0.3f, -0.6f);<br>	glm::vec2 v1(0.0f, 0.7f);<br>	glm::vec2 v2(0.3f, -0.6f);<br><br>	glm::vec2 p1(50, 50);<br>	glm::vec2 p2(90, 50);<br><br>	glm::vec2 a0, a1, a2;<br>	<br>	a0.x = (v0.x + 1) / 2;<br>	a0.y = (1 - v0.y) / 2;<br>	a1.x = (v1.x + 1) / 2;<br>	a1.y = (1 - v1.y) / 2;<br>	a2.x = (v2.x + 1) / 2;<br>	a2.y = (1 - v2.y) / 2;<br><br><br>	v0.x = ((v0.x + 1) / 2) * width;<br>	v0.y = ((1 - v0.y) / 2) * height;<br>	v1.x = ((v1.x + 1) / 2) * width;<br>	v1.y = ((1 - v1.y) / 2) * height;<br>	v2.x = ((v2.x + 1) / 2) * width;<br>	v2.y = ((1 - v2.y) / 2) * height;<br><br><br><br><br>	float insidep11 = edgeFunction(v0, v1, p1);<br>	float insidep12 = edgeFunction(v1, v2, p1);<br>	float insidep13 = edgeFunction(v2, v0, p1);<br><br><br>	bool p1inside;<br><br>	if (insidep11 &lt; 0 &amp;&amp; insidep12 &lt; 0 &amp;&amp; insidep13 &lt; 0) {<br>		p1inside = true;<br>	}<br>	else p1inside = false;<br><br><br>	float insidep21 = edgeFunction(v0, v1, p2);<br>	float insidep22 = edgeFunction(v1, v2, p2);<br>	float insidep23 = edgeFunction(v2, v0, p2);<br><br><br>	bool p2inside;<br><br>	if (insidep21 &lt; 0 &amp;&amp; insidep22 &lt; 0 &amp;&amp; insidep23 &lt; 0) {<br>		p2inside = true;<br>	}<br>	else p2inside = false;<br><br>	std::cout &lt;&lt; "(50,50) : " &lt;&lt; std::boolalpha &lt;&lt; p1inside &lt;&lt; std::endl;<br>	std::cout &lt;&lt; "(90,50) : " &lt;&lt; std::boolalpha &lt;&lt; p2inside &lt;&lt; std::endl;<br>}<br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796480419/f31ce3f528bf50bb43b7f161e6e77d9c/a.png" />
         <pubDate>2022-10-17 02:39:52 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342411448</guid>
      </item>
      <item>
         <title>5470388 이진혁</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342411681</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br><br>	return(c[0] - a[0]) * (a[1] - b[1]) - (a[1] - c[1]) * (b[0] - a[0]);<br><br>}<br><br>int main() {<br>	int width = 100, height = 100;<br><br>	glm::vec2 v0 = { -0.3f, -0.6f };<br>	glm::vec2 v1 = { 0, 0.7f };&nbsp; //중요 포인트 : 2차원 3점을 이용함. 즉, 3차원이 아닌 투사 후의 2차원 점<br>	glm::vec2 v2 = { 0.3f, -0.6f };<br><br>	//raster<br>	v0.x = (float)((v0.x + 1) / 2 * width);<br>	v0.y = (float)((1 - v0.y) / 2 * height);<br><br>	v1.x = (float)((v1.x + 1) / 2 * width);<br>	v1.y = (float)((1 - v1.y) / 2 * height);<br><br>	v2.x = (float)((v2.x + 1) / 2 * width);<br>	v2.y = (float)((1 - v2.y) / 2 * height);<br><br>	glm::vec2 p1(50, 50);<br>	glm::vec2 p2(90, 50);<br><br>	bool insidep1;<br>	bool insidep2;<br><br>	float p1_0 = edgeFunction(v0, v1, p1);<br>	float p1_1 = edgeFunction(v1, v2, p1);<br>	float p1_2 = edgeFunction(v2, v0, p1);<br><br>	float p2_0 = edgeFunction(v0, v1, p2);<br>	float p2_1 = edgeFunction(v1, v2, p2);<br>	float p2_2 = edgeFunction(v2, v0, p2);<br><br>	if (p1_0 &gt; 0 &amp;&amp; p1_1 &gt; 0 &amp;&amp; p1_2 &gt; 0) {<br>		insidep1 = true;<br>	}<br>	else<br>	{<br>		insidep1 = false;<br>	}<br><br>	if (p2_0 &gt; 0 &amp;&amp; p2_1 &gt; 0 &amp;&amp; p2_2 &gt; 0) {<br>		insidep2 = true;<br>	}<br>	else<br>	{<br>		insidep2 = false;<br>	}<br><br>	std::cout &lt;&lt; "P1(50,50) inside? " &lt;&lt; std::boolalpha &lt;&lt; insidep1 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; "P2(90,50) inside? " &lt;&lt; std::boolalpha &lt;&lt; insidep2 &lt;&lt; std::endl;<br><br>	return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1851504660/a111cfb9b6f9a88d948aed08d3b013ad/______2022_10_17_113856.png" />
         <pubDate>2022-10-17 02:40:05 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342411681</guid>
      </item>
      <item>
         <title>5533233 김병창</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342414162</link>
         <description><![CDATA[<div>#define GLM_FORCE_SWIZZLE<br><br>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include&nbsp; &lt;glm/gtx/string_cast.hpp&gt;<br>#include &lt;glm/mat4x4.hpp&gt;<br>#include &lt;glm/mat2x2.hpp&gt;<br>#include &lt;glm/mat3x2.hpp&gt;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	return(c[0] - a[0]) * (b[1] - a[1]) - (c[1] - a[1]) * (b[0] - a[0]);<br>}<br><br>int main()<br>{<br>	int width = 100, height = 100;<br><br>	glm::vec2 v0(-0.3f, -0.6f);<br>	glm::vec2 v1(0.0f, 0.7f);<br>	glm::vec2 v2(0.3f, -0.6f);<br><br>	v0.x = ((v0.x + 1) / 2) * width;<br>	v0.y = ((1 - v0.y) / 2) * height;<br>	v1.x = ((v1.x + 1) / 2) * width;<br>	v1.y = ((1 - v1.y) / 2) * height;<br>	v2.x = ((v2.x + 1) / 2) * width;<br>	v2.y = ((1 - v2.y) / 2) * height;<br><br>	glm::vec2 p1(50, 50);<br>	glm::vec2 p2(90, 50);<br><br>	bool insidep1 = (edgeFunction(v1, v0, p1) &gt; 0) &amp;&amp; (edgeFunction(v2, v1, p1) &gt; 0) &amp;&amp; (edgeFunction(v0, v2, p1) &gt; 0);<br>	bool insidep2 = (edgeFunction(v1, v0, p2) &gt; 0) &amp;&amp; (edgeFunction(v2, v1, p2) &gt; 0) &amp;&amp; (edgeFunction(v0, v2, p2) &gt; 0);<br><br>	std::cout &lt;&lt; "(50,50) : " &lt;&lt; std::boolalpha &lt;&lt; insidep1 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; "(90,50) : " &lt;&lt; std::boolalpha &lt;&lt; insidep2 &lt;&lt; std::endl;<br><br>	return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1621878692/9879ae59592b0043f3622b29af3ece5b/image.png" />
         <pubDate>2022-10-17 02:42:25 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342414162</guid>
      </item>
      <item>
         <title>5534165 신정엽</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342414598</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br>#include &lt;glm/gtc/constants.hpp&gt;<br><br>#define GLM_ENABLE_EXPERIMENTAL<br>#define GLM_FORCE_SWIZZLE<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	return ((c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x) &gt;= 0);<br>}<br><br>int main()&nbsp;<br>{<br>	glm::vec2 v0 = { -0.3f, -0.6f };<br>	glm::vec2 v1 = { 0.0f, 0.7f };<br>	glm::vec2 v2 = { 0.3f, -0.6f };<br>	glm::vec2 p1 = { 50,50 };<br>	glm::vec2 p2 = { 90,50 };<br><br>	glm::vec2 v0Ndc, v1Ndc, v2Ndc;<br><br>	v0Ndc.x = (v0.x + 1) / 2;<br>	v0Ndc.y = (1 - v0.y) / 2;<br>	v1Ndc.x = (v1.x + 1) / 2;<br>	v1Ndc.y = (1 - v1.y) / 2;<br>	v2Ndc.x = (v2.x + 1) / 2;<br>	v2Ndc.y = (1 - v2.y) / 2;<br><br>	glm::vec2 v0Ras,v1Ras,v2Ras;<br><br>	v0Ras.x = (int)(v0Ndc.x * 100);<br>	v0Ras.y = (int)(v0Ndc.x * 100);<br>	v1Ras.x = (int)(v1Ndc.x * 100);<br>	v1Ras.y = (int)(v1Ndc.x * 100);<br>	v2Ras.x = (int)(v2Ndc.x * 100);<br>	v2Ras.y = (int)(v2Ndc.x * 100);<br><br>	if (v0Ras.x == 100) v0Ras.x = 100 - 1;<br>	if (v0Ras.y == 100) v0Ras.y = 100 - 1;<br>	if (v1Ras.x == 100) v1Ras.x = 100 - 1;<br>	if (v1Ras.y == 100) v1Ras.y = 100 - 1;<br>	if (v2Ras.x == 100) v2Ras.x = 100 - 1;<br>	if (v2Ras.y == 100) v2Ras.y = 100 - 1;<br><br>	float w0 = edgeFunction(v1Ras, v2Ras, p1);<br>	float w1 = edgeFunction(v2Ras, v0Ras, p1);<br>	float w2 = edgeFunction(v0Ras, v1Ras, p1);<br><br>	float w3 = edgeFunction(v1Ras, v2Ras, p2);<br>	float w4 = edgeFunction(v2Ras, v0Ras, p2);<br>	float w5 = edgeFunction(v0Ras, v1Ras, p2);<br><br>	bool overlaps;<br>	if (w0 &gt; 0 &amp;&amp; w1 &gt; 0 &amp;&amp; w2 &gt; 0)&nbsp;<br>		overlaps = true;<br>	else&nbsp;<br>		overlaps = false;<br>	std::cout &lt;&lt; "{50,50}" &lt;&lt; (overlaps == 1 ? "true" : "false") &lt;&lt; std::endl;<br><br>	if (w3 &gt; 0 &amp;&amp; w4 &gt; 0 &amp;&amp; w5 &gt; 0)<br>		overlaps = true;<br>	else<br>		overlaps = false;<br>	std::cout &lt;&lt; "{90,50}" &lt;&lt; (overlaps == 1 ? "true" : "false") &lt;&lt; std::endl;<br><br>	return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1851508651/fbdac56f07c55164d77e84238d742bbc/image.png" />
         <pubDate>2022-10-17 02:42:47 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342414598</guid>
      </item>
      <item>
         <title>5533281 박제원</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342415388</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c) {<br>	return ((c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x));<br>}<br><br>int main()<br>{<br>	int width = 100;<br>	int height = 100;<br><br>	glm::vec2 v0 = { -0.3, -0.6 };<br>	glm::vec2 v1 = { 0, 0.7 };<br>	glm::vec2 v2 = { 0.3, -0.6 };<br><br>	glm::vec2 p1 = { 50, 50 };<br>	glm::vec2 p2 = { 90, 50 };<br><br>	//스크린 -&gt; ndc<br><br>	glm::vec2 nor_v0;<br>	nor_v0.x = (v0.x + 1) / 2;<br>	nor_v0.y = (1 - v0.y) / 2;<br><br>	glm::vec2 nor_v1;<br>	nor_v1.x = (v1.x + 1) / 2;<br>	nor_v1.y = (1 - v1.y) / 2;<br><br>	glm::vec2 nor_v2;<br>	nor_v2.x = (v2.x + 1) / 2;<br>	nor_v2.y = (1 - v2.y) / 2;<br>	<br>	glm::ivec2 ras_v0;<br>	ras_v0.x = (int)(nor_v0.x * width);<br>	ras_v0.y = (int)(nor_v0.y * height);<br><br>	glm::ivec2 ras_v1;<br>	ras_v1.x = (int)(nor_v1.x * width);<br>	ras_v1.y = (int)(nor_v1.y * height);<br><br>	glm::ivec2 ras_v2;<br>	ras_v2.x = (int)(nor_v2.x * width);<br>	ras_v2.y = (int)(nor_v2.y * height);<br><br>	float r0 = edgeFunction(ras_v0, ras_v2, p1);<br>	float r1 = edgeFunction(ras_v2, ras_v1, p1);<br>	float r2 = edgeFunction(ras_v1, ras_v0, p1);<br><br>	std::cout &lt;&lt; "p1에 대한 edgefunction 값" &lt;&lt; std::endl;<br>	std::cout &lt;&lt; r0 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; r1 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; r2 &lt;&lt; std::endl;<br><br>	bool inside;<br>	if&nbsp;<br>		(r0 &gt; 0 &amp;&amp; r1 &gt; 0 &amp;&amp; r2 &gt; 0) inside = true;<br>	else&nbsp;<br>		inside = false;<br>	std::cout &lt;&lt; "p1{50, 50}이 안에 있는가" &lt;&lt; (inside == 1 ? "true" : "false") &lt;&lt; std::endl;<br><br>	float r0_ = edgeFunction(ras_v0, ras_v2, p2);<br>	float r1_ = edgeFunction(ras_v2, ras_v1, p2);<br>	float r2_ = edgeFunction(ras_v1, ras_v0, p2);<br><br>	std::cout &lt;&lt; "p2에 대한 edgefunction 값" &lt;&lt; std::endl;<br>	std::cout &lt;&lt; r0_ &lt;&lt; std::endl;<br>	std::cout &lt;&lt; r1_ &lt;&lt; std::endl;<br>	std::cout &lt;&lt; r2_ &lt;&lt; std::endl;<br><br>	if (r0_ &gt; 0 &amp;&amp; r1_ &gt; 0 &amp;&amp; r2_ &gt; 0)&nbsp;<br>		inside = true;<br>	else&nbsp;<br>		inside = false;<br>	std::cout &lt;&lt; "p1{50, 50}이 안에 있는가" &lt;&lt; (inside == 1 ? "true" : "false") &lt;&lt; std::endl;<br>	<br>	return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1621869236/6f52c8c4ee72589b7cd1cd3633863a3d/image.png" />
         <pubDate>2022-10-17 02:43:33 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342415388</guid>
      </item>
      <item>
         <title>5470508 한승욱</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342416014</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include &lt;glm/gtc/constants.hpp&gt;<br>#define GLM_FORCE_SWIZZLE<br><br><br>using namespace glm;<br>using namespace std;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	return (c[0] - a[0]) * (a[1] - b[1]) - (a[1] - c[1]) * (b[0] - a[0]);<br>}<br><br>vec2 normalizedVec(vec2&amp; a)&nbsp;<br>{<br>	a.x = (a.x + 1) / 2;<br>	a.y = (1 - a.y) / 2;<br>	return a;<br>}<br>vec2 rasterVec(vec2&amp; a)<br>{<br>	a.x = a.x * 100;<br>	a.y = a.y * 100;<br>	return a;<br>}<br>int main()<br>{<br>	int width = 100, height = 100;<br><br>	vec2 v0 = { -0.3,-0.6 };<br>	vec2 v1 = { 0,0.7 };<br>	vec2 v2 = { 0.3,-0.6 };<br><br>	vec2 p1 = { 50,50 };<br>	vec2 p2 = { 90,50 };<br><br>	v0 = normalizedVec(v0);<br>	v1 = normalizedVec(v1);<br>	v2 = normalizedVec(v2);<br><br>	v0 = rasterVec(v0);<br>	v1 = rasterVec(v1);<br>	v2 = rasterVec(v2);<br><br>	cout &lt;&lt; "v0 레스터" &lt;&lt; to_string(v0) &lt;&lt; endl;<br>	cout &lt;&lt; "v1 레스터" &lt;&lt; to_string(v1) &lt;&lt; endl;<br>	cout &lt;&lt; "v2 레스터" &lt;&lt; to_string(v2) &lt;&lt; endl;<br><br>	float w0 = edgeFunction(v0, v1, p1);<br>	float w1 = edgeFunction(v1, v2, p1);<br>	float w2 = edgeFunction(v2, v0, p1);<br><br>	bool inside1 = (w0 &gt; 0 &amp;&amp; w1 &gt; 0 &amp;&amp; w2 &gt; 0);<br><br>	cout &lt;&lt; "edgeFunction w0(v0,v1,p1) = " &lt;&lt; w0 &lt;&lt; endl;<br>	cout &lt;&lt; "edgeFunction w1(v1,v2,p1) = " &lt;&lt; w1 &lt;&lt; endl;<br>	cout &lt;&lt; "edgeFunction w2(v2,v0,p1) = " &lt;&lt; w2 &lt;&lt; endl;<br><br>	if (inside1)<br>	{<br>		cout &lt;&lt; "p1 : "&lt;&lt;inside1&lt;&lt; endl;<br>	}<br>	else&nbsp;<br>	{<br>		cout &lt;&lt; "p1 : "&lt;&lt;inside1 &lt;&lt; endl;<br>	}<br><br>	w0 = edgeFunction(v0, v1, p2);<br>	 w1 = edgeFunction(v1, v2, p2);<br>	 w2 = edgeFunction(v2, v0, p2);<br>	 bool inside2 = (w0 &gt; 0 &amp;&amp; w1 &gt; 0 &amp;&amp; w2 &gt; 0);<br><br>	 cout &lt;&lt; "edgeFunction w0(v0,v1,p2) = " &lt;&lt; w0 &lt;&lt; endl;<br>	 cout &lt;&lt; "edgeFunction w1(v1,v2,p2) = " &lt;&lt; w1 &lt;&lt; endl;<br>	 cout &lt;&lt; "edgeFunction w2(v2,v0,p2) = " &lt;&lt; w2 &lt;&lt; endl;<br><br>	 if (inside2)<br>	 {<br>		 cout &lt;&lt; "p2 : "&lt;&lt;inside2 &lt;&lt; endl;<br>	 }<br>	 else<br>	 {<br>		 cout &lt;&lt; "p2 : "&lt;&lt;inside2 &lt;&lt; endl;<br>	 }<br><br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1832040951/a4b27ef5d36a3050b2b4285455b3eb92/20221017_123310.png" />
         <pubDate>2022-10-17 02:44:03 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342416014</guid>
      </item>
      <item>
         <title>5585620 조이솔</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342416269</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br><br>bool edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c) {<br>	return ((c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x) &gt;= 0);<br>}<br><br>int main()<br>{<br>	glm::vec2 v0(-0.3f, -0.6f);<br>	glm::vec2 v1(0.3f, -0.6f);<br>	glm::vec2 v2(0, 0.7f);<br>	glm::vec2 p1(50, 50);<br>	glm::vec2 p2(90, 50);<br><br>	glm::vec2 ndc_v0;<br>	glm::vec2 ndc_v1;<br>	glm::vec2 ndc_v2;<br><br>	ndc_v0.x = (v0.x + 1) / 2;<br>	ndc_v0.y = (1 - v0.y) / 2;<br><br>	ndc_v1.x = (v1.x + 1) / 2;<br>	ndc_v1.y = (1 - v1.y) / 2;<br><br>	ndc_v2.x = (v2.x + 1) / 2;<br>	ndc_v2.y = (1 - v2.y) / 2;<br><br>	glm::vec2 raster_v0;<br>	glm::vec2 raster_v1;<br>	glm::vec2 raster_v2;<br><br>	raster_v0.x = (int)(ndc_v0.x * 100);<br>	raster_v0.y = (int)(ndc_v0.y * 100);<br>	raster_v1.x = (int)(ndc_v1.x * 100);<br>	raster_v1.y = (int)(ndc_v1.y * 100);<br>	raster_v2.x = (int)(ndc_v2.x * 100);<br>	raster_v2.y = (int)(ndc_v2.y * 100);<br><br>	if (raster_v0.x == 100) raster_v0.x = 100 - 1;<br>	if (raster_v0.y == 100) raster_v0.y = 100 - 1;<br>	if (raster_v1.x == 100) raster_v1.x = 100 - 1;<br>	if (raster_v1.y == 100) raster_v1.y = 100 - 1;<br>	if (raster_v2.x == 100) raster_v2.x = 100 - 1;<br>	if (raster_v2.y == 100) raster_v2.y = 100 - 1;<br><br>	bool p1_w0 = edgeFunction(raster_v1, raster_v2, p1);<br>	bool p1_w1 = edgeFunction(raster_v2, raster_v0, p1);<br>	bool p1_w2 = edgeFunction(raster_v0, raster_v1, p1);<br><br>	bool p2_w0 = edgeFunction(raster_v1, raster_v2, p2);<br>	bool p2_w1 = edgeFunction(raster_v2, raster_v0, p2);<br>	bool p2_w2 = edgeFunction(raster_v0, raster_v1, p2);<br><br>	glm::vec2 edge0 = raster_v0 - raster_v1;<br>	glm::vec2 edge1 = raster_v0 - raster_v0;<br>	glm::vec2 edge2 = raster_v1 - raster_v0;<br><br>	bool inside_P1 = true;<br>	bool inside_P2 = true;<br><br>	if (p1_w0 == true &amp;&amp; p1_w1 == true &amp;&amp; p1_w2 == true)<br>		inside_P1 = true;<br>	else<br>		inside_P1 = false;<br><br>	if (p2_w0 == true &amp;&amp; p2_w1 == true &amp;&amp; p2_w2 == true)<br>		inside_P2 = true;<br>	else<br>		inside_P2 = false;<br><br>	if (inside_P1)<br>		std::cout &lt;&lt; "p1 is inside" &lt;&lt; std::endl;<br>	else if (!inside_P1)<br>		std::cout &lt;&lt; "p1 is outside" &lt;&lt; std::endl;<br><br>	if (inside_P2)<br>		std::cout &lt;&lt; "p2 is inside" &lt;&lt; std::endl;<br>	else if (!inside_P2)<br>		std::cout &lt;&lt; "p2 is outside" &lt;&lt; std::endl;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1644064937/4ed72563cd2e47bbf0fc018c317dafc2/image.png" />
         <pubDate>2022-10-17 02:44:18 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342416269</guid>
      </item>
      <item>
         <title>5585330 김지윤</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342420034</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/vec2.hpp&gt;<br>#include &lt;glm/vec3.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c) {<br>	return (c[0] - a[0]) * (b[1] - a[1]) - (c[1] - a[1]) * (b[0] - a[0]);<br>}<br><br>glm::vec2 coordinateFunction(const glm::vec2 vec) {<br>	int width = 100;&nbsp;<br>	int height = 100;<br><br>	glm::vec2 ndc_raster_vec;<br><br>	ndc_raster_vec.x = (int)((vec.x + 1) / 2 * width);<br>	ndc_raster_vec.y = (int)((1 - vec.y) / 2 * height);<br><br>	if (ndc_raster_vec.x == width) ndc_raster_vec.x = width - 1;<br>	if (ndc_raster_vec.y == height) ndc_raster_vec.y = height - 1;<br><br>	return ndc_raster_vec;<br>}<br><br>int main() {<br>	int width = 100;<br>	int height = 100;<br><br>	glm::vec2 v0(-0.3, -0.6);<br>	glm::vec2 v1(0.3, -0.6);<br>	glm::vec2 v2(0, 0.7);<br><br>	glm::vec2 v0_raster = coordinateFunction(v0);<br>	glm::vec2 v1_raster = coordinateFunction(v1);<br>	glm::vec2 v2_raster = coordinateFunction(v2);<br><br>	glm::vec2 p1(50, 50);<br>	glm::vec2 p2(90, 50);<br><br>	float w01 = edgeFunction(v1_raster, v2_raster, p1);<br>	float w11 = edgeFunction(v2_raster, v0_raster, p1);<br>	float w21 = edgeFunction(v0_raster, v1_raster, p1);<br><br>	float w02 = edgeFunction(v1_raster, v2_raster, p2);<br>	float w12 = edgeFunction(v2_raster, v0_raster, p2);<br>	float w22 = edgeFunction(v0_raster, v1_raster, p2);<br><br>	glm::vec2 edge0 = v2 - v1;<br>	glm::vec2 edge1 = v0 - v2;<br>	glm::vec2 edge2 = v1 - v0;<br><br>	std::cout &lt;&lt; "v0_raster: " + to_string(v0_raster) &lt;&lt; std::endl;<br>	std::cout &lt;&lt; "v1_raster: " + to_string(v1_raster) &lt;&lt; std::endl;<br>	std::cout &lt;&lt; "v2_raster: " + to_string(v2_raster) &lt;&lt; std::endl;<br><br>	bool overlaps_p1 = true;<br>	bool overlaps_p2 = true;<br><br>	overlaps_p1 &amp;= (w01 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (w01 &gt; 0));<br>	overlaps_p1 &amp;= (w11 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (w11 &gt; 0));<br>	overlaps_p1 &amp;= (w21 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (w21 &gt; 0));<br><br>	overlaps_p2 &amp;= (w02 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (w02 &gt; 0));<br>	overlaps_p2 &amp;= (w12 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (w12 &gt; 0));<br>	overlaps_p2 &amp;= (w22 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (w22 &gt; 0));<br><br>	if (overlaps_p1) {<br>		std::cout &lt;&lt; "p1: 이 점은 내부에 있습니다." &lt;&lt; std::endl;<br>	}<br>	else<br>		std::cout &lt;&lt; "p1: 이 점은 외부에 있습니다." &lt;&lt; std::endl;<br><br>	if (overlaps_p2) {<br>		std::cout &lt;&lt; "p2: 이 점은 내부에 있습니다." &lt;&lt; std::endl;<br>	}<br>	else<br>		std::cout &lt;&lt; "p2: 이 점은 외부에 있습니다." &lt;&lt; std::endl;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1851547318/4b2724a8004f52478f8c671ecf6a7233/__.JPG" />
         <pubDate>2022-10-17 02:47:24 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342420034</guid>
      </item>
      <item>
         <title>5533600 홍강민</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342420195</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br><br>inline float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	return(c[0] - a[0]) * (b[1] - a[1]) - (c[1] - a[1]) * (b[0] - a[0]);<br>}<br><br>int main()<br>{<br>	glm::vec2 v0 = { -0.3, -0.6 };<br>	glm::vec2 v1 = { 0, 0.7 };<br>	glm::vec2 v2 = { 0.3, -0.6 };<br><br>	glm::vec2 p1 = { 50, 50 };<br>	glm::vec2 p2 = { 90, 50 };<br><br>	int width = 100;<br>	int height = 100;<br><br>	v0.x = (v0.x + 1) / 2;<br>	v0.y = (1 - v0.y) / 2;<br><br>	v1.x = (v1.x + 1) / 2;<br>	v1.y = (1 - v1.y) / 2;<br><br>	v2.x = (v2.x + 1) / 2;<br>	v2.y = (1 - v2.y) / 2;<br><br>	glm::ivec2 v0_raster;<br>	glm::ivec2 v1_raster;<br>	glm::ivec2 v2_raster;<br><br>	v0_raster.x = (int)(v0.x * width);<br>	v0_raster.y = (int)(v0.y * height);<br>	if (v0_raster.x == width) v0_raster.x = width - 1;<br>	if (v0_raster.y == height) v0_raster.y = height - 1;<br><br>	v1_raster.x = (int)(v1.x * width);<br>	v1_raster.y = (int)(v1.y * height);<br>	if (v1_raster.x == width) v1_raster.x = width - 1;<br>	if (v1_raster.y == height) v1_raster.y = height - 1;<br><br>	v2_raster.x = (int)(v2.x * width);<br>	v2_raster.y = (int)(v2.y * height);<br>	if (v2_raster.x == width) v2_raster.x = width - 1;<br>	if (v2_raster.y == height) v2_raster.y = height - 1;<br><br>	float z0 = edgeFunction(v0_raster, v1_raster, p1);<br>	float z1 = edgeFunction(v1_raster, v2_raster, p1);<br>	float z2 = edgeFunction(v2_raster, v0_raster, p1);<br><br>	bool overlaps = true;<br>	if (z0 &gt; 0 &amp;&amp; z1 &gt; 0 &amp;&amp; z2 &gt; 0)<br>	{<br>		overlaps = true;<br>	}<br>	else if (z0 &lt; 0 &amp;&amp; z1 &lt; 0 &amp;&amp; z2 &lt; 0)<br>	{<br>		overlaps = true;<br>	}<br>	else<br>	{<br>		overlaps = false;<br>	}<br><br><br>	std::cout &lt;&lt; z0 &lt;&lt; z1 &lt;&lt; z2 &lt;&lt; std::endl;<br><br>	if (overlaps == true)<br>	{<br>		std::cout &lt;&lt; "True" &lt;&lt; std::endl;<br>	}<br>	else<br>	{<br>		std::cout &lt;&lt; "False" &lt;&lt; std::endl;<br>	}<br><br>	float w0 = edgeFunction(v1_raster, v2_raster, p2);<br>	float w1 = edgeFunction(v2_raster, v0_raster, p2);<br>	float w2 = edgeFunction(v0_raster, v1_raster, p2);<br><br>	bool overlaps2 = true;<br><br>	if (w0 &gt; 0 &amp;&amp; w1 &gt; 0 &amp;&amp; w2 &gt; 0)<br>	{<br>		overlaps2 = true;<br>	}<br>	else<br>	{<br>		overlaps2 = false;<br>	}<br><br>	std::cout &lt;&lt; w0 &lt;&lt; w1 &lt;&lt; w2 &lt;&lt; std::endl;<br><br>	if (overlaps2 == true)<br>	{<br>		std::cout &lt;&lt; "True" &lt;&lt; std::endl;<br>	}<br>	else<br>	{<br>		std::cout &lt;&lt; "False" &lt;&lt; std::endl;<br>	}<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796481604/af41d2aea11ff76cba36f119dca32353/__.PNG" />
         <pubDate>2022-10-17 02:47:32 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342420195</guid>
      </item>
      <item>
         <title>5533307 박지민</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342471164</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include&nbsp; &lt;glm/gtx/string_cast.hpp&gt;<br><br>using namespace std;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c) {<br>	return { (c[0] - a[0]) * (b[1] - a[1]) - (c[1] - a[1]) * (b[0] - a[0]) };<br>}<br><br>int main() {<br>	int width = 100;<br>	int height = 100;<br><br>	glm::vec2 v0(-0.3, -0.6);<br>	glm::vec2 v1(0, 0.7);<br>	glm::vec2 v2(0.3, -0.6);<br>	glm::vec2 p1(50, 50);<br>	glm::vec2 p2(90, 50);<br><br>	glm::vec2 v_0 = { (v0.x + 1) / 2, (1 - v0.y) / 2 };<br>	glm::vec2 v_1 = { (v1.x + 1) / 2, (1 - v1.y) / 2 };<br>	glm::vec2 v_2 = { (v2.x + 1) / 2, (1 - v2.y) / 2 };<br><br>	glm::ivec2 v_0r = { (int)((v_0.x) * width), (int)((v_0.y) * height) };<br>	glm::ivec2 v_1r = { (int)((v_1.x) * width), (int)((v_1.y) * height) };<br>	glm::ivec2 v_2r = { (int)((v_2.x) * width), (int)((v_2.y) * height) };<br><br>	float w0 = edgeFunction(v_1r, v_0r, p1);<br>	float w1 = edgeFunction(v_2r, v_1r, p1);<br>	float w2 = edgeFunction(v_0r, v_2r, p1);<br>	<br>	float w_0 = edgeFunction(v_1r, v_0r, p2);<br>	float w_1 = edgeFunction(v_2r, v_1r, p2);<br>	float w_2 = edgeFunction(v_0r, v_2r, p2);<br><br>	if (w0 &gt;= 0 &amp;&amp; w1 &gt;= 0 &amp;&amp; w2 &gt;= 0) {<br>		cout &lt;&lt; "(50,50) : " &lt;&lt; "inside" &lt;&lt; endl;<br>	}<br>	else<br>	{<br>		cout &lt;&lt; "(50,50) : " &lt;&lt; "outside" &lt;&lt; endl;<br>	}<br><br>	if (w_0 &gt;= 0 &amp;&amp; w_1 &gt;= 0 &amp;&amp; w_2 &gt;= 0) {<br>		cout &lt;&lt; "(90,50) : " &lt;&lt; "inside" &lt;&lt; endl;<br>	}<br>	else<br>	{<br>		cout &lt;&lt; "(90,50) : " &lt;&lt; "outside" &lt;&lt; endl;<br>	}<br>	return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1621868328/7edec4d44c050bed409e29fa1c98c18b/dsdsds.PNG" />
         <pubDate>2022-10-17 03:33:20 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342471164</guid>
      </item>
      <item>
         <title>5298150서보균</title>
         <author>sbk3358</author>
         <link>https://padlet.com/mksung89/edge/wish/2342479289</link>
         <description><![CDATA[<div><br>#include&lt;iostream&gt;<br>#include&lt;glm/glm.hpp&gt;<br>#include&lt;glm/gtx/string_cast.hpp&gt;<br>#include&lt;glm/gtx/transform.hpp&gt;<br>#include&lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include&lt;stdio.h&gt;<br><br>#define GLM_FORCE_SWIZZLE<br><br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c);<br>glm::vec2 GetRaster(glm::vec2 v);<br><br>int width = 100;<br>int height = 100;<br><br>int main()<br>{<br><br>	glm::vec2 v0 = glm::vec2(-0.3, -0.6);<br>	glm::vec2 v1 = glm::vec2(0, 0.7);<br>	glm::vec2 v2 = glm::vec2(0.3, -0.6);<br><br>	glm::vec2 p1 = glm::vec2(50, 50);<br>	glm::vec2 p2 = glm::vec2(90, 50);<br><br>	glm::vec2 v0Raster = GetRaster(v0);<br>	glm::vec2 v1Raster = GetRaster(v1);<br>	glm::vec2 v2Raster = GetRaster(v2);<br><br>	std::cout &lt;&lt; "v0 레스터라이저: " &lt;&lt; glm::to_string(v0Raster) &lt;&lt; std::endl;<br>	std::cout &lt;&lt; "v1 레스터라이저: " &lt;&lt; glm::to_string(v1Raster) &lt;&lt; std::endl;<br>	std::cout &lt;&lt; "v2 레스터라이저: " &lt;&lt; glm::to_string(v2Raster) &lt;&lt; std::endl;<br><br><br>	bool check1 = true;<br>	bool check2 = true;<br>	bool check3 = true;<br>	if (edgeFunction(v0Raster, v1Raster, p1) &lt; 0)<br>		check1 = false;<br>	if (edgeFunction(v1Raster, v2Raster, p1) &lt; 0)<br>		check2 = false;<br>	if (edgeFunction(v2Raster, v0Raster, p1) &lt; 0)<br>		check3 = false;<br><br>	if (check1 &amp;&amp; check2 &amp;&amp; check3)<br>		std::cout &lt;&lt; "p1은 안에 있음." &lt;&lt; std::endl;<br>	else<br>		std::cout &lt;&lt; "p1은 밖에 있음." &lt;&lt; std::endl;<br><br><br>	check1 = true;<br>	check2 = true;<br>	check3 = true;<br><br>	if (edgeFunction(v0Raster, v1Raster, p2) &lt; 0)<br>		check1 = false;<br>	if (edgeFunction(v1Raster, v2Raster, p2) &lt; 0)<br>		check2 = false;<br>	if (edgeFunction(v2Raster, v0Raster, p2) &lt; 0)<br>		check3 = false;<br><br>	if (check1 &amp;&amp; check2 &amp;&amp; check3)<br>		std::cout &lt;&lt; "p2는 안에 있음." &lt;&lt; std::endl;<br>	else<br>		std::cout &lt;&lt; "p2는 밖에 있음." &lt;&lt; std::endl;<br><br>	return 0;<br>}<br><br>glm::vec2 GetRaster(glm::vec2 v)<br>{<br>	glm::vec2 P_proj_nor = glm::vec2(0,0);<br><br>	P_proj_nor.x = (v.x + 1) / 2;<br>	P_proj_nor.y = (1 - v.y) / 2;<br><br>	glm::vec2 P_proj_raster = glm::vec2(0, 0);<br><br>	P_proj_raster.x = (int)(P_proj_nor.x * width);<br>	P_proj_raster.y = (int)(P_proj_nor.y * height);<br>	if (P_proj_raster.x == width) P_proj_raster.x = width - 1;<br>	if (P_proj_raster.y == height) P_proj_raster.y = height - 1;<br><br>	return P_proj_raster;<br>}<br><br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	return (c[0] - a[0]) * (a[1] - b[1]) - (a[1] - c[1]) * (b[0] - a[0]);<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796477942/6adfa0f2491f7d2c9bc359aa1fa205cc/image.png" />
         <pubDate>2022-10-17 03:42:04 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342479289</guid>
      </item>
      <item>
         <title>5533338 박태영</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342482780</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br>#include &lt;glm/gtc/constants.hpp&gt;<br>#include &lt;glm/mat4x4.hpp&gt;<br>#include &lt;glm/mat3x3.hpp&gt;<br>#include &lt;glm/mat2x2.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br><br><br>//#define GLM_ENABLE_EXPERIMENTAL<br>#define GLM_FORCE_SWIZZLE<br><br>const double DEGREES_TO_RADIANS = glm::pi&lt;float&gt;() / 180.0;<br>const double RADIANS_TO_DEGREES = 180.0 / glm::pi&lt;float&gt;();<br><br>bool edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{&nbsp;<br>&nbsp; &nbsp; return ((c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x) &gt;= 0);&nbsp;<br>}&nbsp;<br><br>int main()<br>{<br>&nbsp; &nbsp; int width = 100;<br>&nbsp; &nbsp; int height = 100;<br>&nbsp; &nbsp; glm::vec2 v0(-0.3f, -0.6f);<br>&nbsp; &nbsp; glm::vec2 v1(0.3f, -0.6f);<br>&nbsp; &nbsp; glm::vec2 v2(0.0f, 0.7f);<br>&nbsp; &nbsp; glm::vec2 p1(50, 50);<br>&nbsp; &nbsp; glm::vec2 p2(90, 50);<br><br>&nbsp; &nbsp; glm::vec2 v0nor;<br>&nbsp; &nbsp; glm::vec2 v1nor;<br>&nbsp; &nbsp; glm::vec2 v2nor;<br><br>&nbsp; &nbsp; v0nor.x = (v0.x + 1) / 2;<br>&nbsp; &nbsp; v0nor.y = (1 - v0.y) / 2;<br><br>&nbsp; &nbsp; v1nor.x = (v1.x + 1) / 2;<br>&nbsp; &nbsp; v1nor.y = (1 - v1.y) / 2;<br><br>&nbsp; &nbsp; v2nor.x = (v2.x + 1) / 2;<br>&nbsp; &nbsp; v2nor.y = (1 - v2.y) / 2;<br><br>&nbsp; &nbsp; glm::vec2 v0ras;<br>&nbsp; &nbsp; glm::vec2 v1ras;<br>&nbsp; &nbsp; glm::vec2 v2ras;<br><br>&nbsp; &nbsp; v0ras.x = (int)(v0nor.x * width);<br>&nbsp; &nbsp; v0ras.y = (int)(v0nor.y * height);<br><br>&nbsp; &nbsp; v1ras.x = (int)(v1nor.x * width);<br>&nbsp; &nbsp; v1ras.y = (int)(v1nor.y * height);<br><br>&nbsp; &nbsp; v2ras.x = (int)(v2nor.x * width);<br>&nbsp; &nbsp; v2ras.y = (int)(v2nor.y * height);<br><br>&nbsp; &nbsp; if (v0ras.x == width)&nbsp; v0ras.x = width&nbsp; - 1;<br>&nbsp; &nbsp; if (v0ras.y == height)v0ras.y = height - 1;<br><br>&nbsp; &nbsp; if (v1ras.x == width)&nbsp; v1ras.x = width - 1;<br>&nbsp; &nbsp; if (v1ras.y == height) v1ras.y = height - 1;<br><br>&nbsp; &nbsp; if (v2ras.x == width)&nbsp; v2ras.x = width - 1;<br>&nbsp; &nbsp; if (v2ras.y == height) v2ras.y = height - 1;<br><br>&nbsp; &nbsp; bool w0_1 = edgeFunction(v1ras, v2ras, p1);<br>&nbsp; &nbsp; bool w1_1 = edgeFunction(v2ras, v0ras, p1);<br>&nbsp; &nbsp; bool w2_1 = edgeFunction(v0ras, v1ras, p1);<br>&nbsp; &nbsp; bool w0_2 = edgeFunction(v1ras, v2ras, p2);<br>&nbsp; &nbsp; bool w1_2 = edgeFunction(v2ras, v0ras, p2);<br>&nbsp; &nbsp; bool w2_2 = edgeFunction(v0ras, v1ras, p2);<br><br>&nbsp; &nbsp; bool inp1,inp2;<br><br>&nbsp; &nbsp; if (w0_1 == true &amp;&amp; w1_1 == true &amp;&amp; w2_1 == true)&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(50,50) : inside" &lt;&lt; std::endl;<br>&nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(50,50) : outside" &lt;&lt; std::endl;<br><br>&nbsp; &nbsp; if (w0_2 == true &amp;&amp; w1_2 == true &amp;&amp; w2_2 == true)&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(90,50) : inside" &lt;&lt; std::endl;<br>&nbsp; &nbsp; else&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(90,50) : outside" &lt;&lt; std::endl;<br><br>	return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1706424602/81a4b857388d7496a031518af6872d57/ras.PNG" />
         <pubDate>2022-10-17 03:45:58 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342482780</guid>
      </item>
      <item>
         <title>5533278 박재현</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342514473</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/mat4x4.hpp&gt;<br>#include &lt;glm/mat2x2.hpp&gt;<br>#include &lt;glm/mat3x2.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br><br>bool edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	return((c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x) &gt; 0);<br>}<br><br>float edgeFunctionF(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	return(c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x);<br>}<br><br>int main()<br>{<br>	glm::vec2 v = { -0.3, -0.6 };<br>	glm::vec2 v1 = { 0, 0.7 };<br>	glm::vec2 v2 = { 0.3, -0.6 };<br><br>	glm::vec2 P1 = { 50, 50 };<br>	glm::vec2 P2 = { 90, 50 };<br><br>	const uint32_t w = 100;<br>	const uint32_t h = 100;<br><br>	glm::vec2 V;<br>	V.x = (v.x + 1) / 2;<br>	V.y = (1 - v.y) / 2;<br>	glm::vec2 V1;<br>	V1.x = (v1.x + 1) / 2;<br>	V1.y = (1 - v1.y) / 2;<br>	glm::vec2 V2;<br>	V2.x = (v2.x + 1) / 2;<br>	V2.y = (1 - v2.y) / 2;<br><br>	glm::vec2 a;<br>	a.x = (int)(V.x * w);<br>	a.y = (int)(V.y * h);<br>	if (a.x == w) a.x = w - 1;<br>	if (a.y == h) a.y = h - 1;<br><br>	glm::vec2 b;<br>	b.x = (int)(V1.x * w);<br>	b.y = (int)(V1.y * h);<br>	if (b.x == w) b.x = w - 1;<br>	if (b.y == h) b.y = h - 1;<br><br>	glm::vec2 c;<br>	c.x = (int)(V2.x * w);<br>	c.y = (int)(V2.y * h);<br>	if (c.x == w) c.x = w - 1;<br>	if (c.y == h) c.y = h - 1;<br><br>	bool w0 = edgeFunction(b, a, P1);<br>	bool w1 = edgeFunction(c, b, P1);<br>	bool w2 = edgeFunction(a, c, P1);<br><br>	bool x0 = edgeFunction(b, a, P2);<br>	bool x1 = edgeFunction(c, b, P2);<br>	bool x2 = edgeFunction(a, c, P2);<br><br>	bool _P1;<br>	bool _P2;<br><br>	if (w0 == true &amp;&amp; w1 == true &amp;&amp; w2 == true)<br>	{<br>		_P1 = true;<br>	}<br>	else {<br>		_P1 = false;<br>	}<br><br>	if (x0 == true &amp;&amp; x1 == true &amp;&amp; x2 == true)<br>	{<br>		_P2 = true;<br>	}<br>	else<br>	{<br>		_P2 = false;<br>	}<br><br>	if (_P1 == true) {<br>		std::cout &lt;&lt; "P1(50,50) is inside" &lt;&lt; std::endl;<br>	}<br>	else if (_P1 == false) {<br>		std::cout &lt;&lt; "P1(50,50) is outside" &lt;&lt; std::endl;<br>	}<br><br>	if (_P2 == true) {<br>		std::cout &lt;&lt; "P2(90,50) is inside" &lt;&lt; std::endl;<br>	}<br>	else if (_P2 == false) {<br>		std::cout &lt;&lt; "P2(90,50) is outside" &lt;&lt; std::endl;<br>	}<br><br>	return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1851520195/72bd1ade74ddd1c7196587a5b29f67c2/10_17.PNG" />
         <pubDate>2022-10-17 04:20:07 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342514473</guid>
      </item>
      <item>
         <title>5646065 박은영</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342526156</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c) {<br>	return(c[0] - a[0])* (b[1] - a[1]) - (c[1] - a[1]) * (b[0] - a[0]);<br>}<br><br>int main() {<br>	int width = 100, height = 100; //이미지 해상도<br><br>	glm::vec3 p1(50, 50, 0);	// 포인트 1<br>	glm::vec3 p2(90, 50, 0);	// 포인트 2<br><br>	// screen space<br>	glm::vec2 v0(-0.3, -0.6);<br>	glm::vec2 v1(0.3, -0.6);<br>	glm::vec2 v2(0, 0.7);<br><br>	// ndc + raster<br>	glm::vec2 _v0, _v1, _v2;<br>	_v0.x = ((v0.x + 1) / 2) * 100;<br>	_v0.y = ((1 - v0.y) / 2) * 100;<br>	_v1.x = ((v1.x + 1) / 2) * 100;<br>	_v1.y = ((1 - v1.y) / 2) * 100;<br>	_v2.x = ((v2.x + 1) / 2) * 100;<br>	_v2.y = ((1 - v2.y) / 2) * 100;<br><br>	if (_v0.x == width)<br>		_v0.x = width - 1;<br>	if (_v0.y == height)<br>		_v0.y = height - 1;<br>	if (_v1.x == width)<br>		_v1.x = width - 1;<br>	if (_v1.y == height)<br>		_v1.y = height - 1;<br>	if (_v2.x == width)<br>		_v2.x = width - 1;<br>	if (v2.y == height)<br>		v2.y = height - 1;<br><br>	bool inside1, inside2;<br><br>	float p1_w0 = edgeFunction(_v1, _v2, p1);<br>	float p1_w1 = edgeFunction(_v2, _v0, p1);<br>	float p1_w2 = edgeFunction(_v0, _v1, p1);<br>	if (p1_w0 &gt; 0 &amp;&amp; p1_w1 &gt; 0 &amp;&amp; p1_w2 &gt; 0)<br>		inside1 = true;<br>	else inside1 = false;<br>	std::cout &lt;&lt; "P1 is inside? = ";<br>	if (inside1)<br>		std::cout &lt;&lt; "true";<br>	else<br>		std::cout &lt;&lt; "false";<br><br>	float p2_w0 = edgeFunction(_v1, _v2, p2);<br>	float p2_w1 = edgeFunction(_v2, _v0, p2);<br>	float p2_w2 = edgeFunction(_v0, _v1, p2);<br>	if (p2_w0 &gt; 0 &amp;&amp; p2_w1 &gt; 0 &amp;&amp; p2_w2 &gt; 0)<br>		inside2 = true;<br>	else inside2 = false;<br>	std::cout &lt;&lt; "\nP2 is inside? = ";<br>	if (inside2)<br>		std::cout &lt;&lt; "true";<br>	else<br>		std::cout &lt;&lt; "false";<br><br>	return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1851510578/54ba028f018fe27e005608a94b71114c/image.png" />
         <pubDate>2022-10-17 04:30:22 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342526156</guid>
      </item>
      <item>
         <title>5585802 박하은</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342528904</link>
         <description><![CDATA[<div>#define GLM_ENABLE_EXPERIMENTAL<br><br>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br><br>glm::vec2 screen_to_raster(const glm::vec2&amp; v, int width, int height)<br>{<br>	glm::vec2 result;<br>	result.x = (int)(((v.x + 1) / 2) * width);<br>	result.y = (int)(((1 - v.y) / 2) * height);<br><br>	return result;<br>}<br><br>glm::vec2 screen_to_ndc(glm::vec2&amp; v)<br>{<br>	glm::vec2 result;<br>	result.x = (v.x + 1) / 2;<br>	result.y = (v.y + 1) / 2;<br>	return result;<br>}<br><br>glm::vec2 ndc_to_raster(const glm::vec2&amp; v, int w, int h)<br>{<br>	glm::vec2 result;<br>	result.x = v.x * w;<br>	result.y = -1 * v.y * h;<br>	return result;<br>}<br><br>bool edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	if (a.y &gt;= 0)<br>	{<br>		return ((c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x) &gt;= 0);<br>	}<br>	else<br>	{<br>		return (-(c.x - a.x) * (b.y - a.y) + (-c.y - a.y) * (b.x - a.x) &gt;= 0);<br>	}<br>}<br><br>bool is_inside(const glm::vec2&amp; v0, const glm::vec2&amp; v1, const glm::vec2&amp; v2, const glm::vec2&amp; p)<br>{<br>	float w0 = edgeFunction(v1, v2, p);<br>	float w1 = edgeFunction(v2, v0, p);<br>	float w2 = edgeFunction(v0, v1, p);<br>	std::cout &lt;&lt; "" &lt;&lt; w0 &lt;&lt; ", " &lt;&lt; w1 &lt;&lt; ", " &lt;&lt; w2 &lt;&lt; "\n ";<br>	glm::vec2 edge0 = v2 - v1;<br>	glm::vec2 edge1 = v0 - v2;<br>	glm::vec2 edge2 = v1 - v0;<br><br>	bool inside = true;<br>	inside &amp;= edgeFunction(v0, v1, p);<br>	inside &amp;= edgeFunction(v1, v2, p);<br>	inside &amp;= edgeFunction(v2, v0, p);<br>	return inside;<br>}<br><br><br>int main()<br>{<br>	const int width = 100, height = 100;<br><br>	glm::vec2 v0 = { -0.3f, -0.6f };<br>	glm::vec2 v1 = { 0.f, 0.7f };<br>	glm::vec2 v2 = { 0.3f, -0.6f };<br><br>	glm::vec2 p1 = { 50,50 };<br>	glm::vec2 p2 = { 90,50 };<br><br>	v0 = screen_to_ndc(v0);<br>	v1 = screen_to_ndc(v1);<br>	v2 = screen_to_ndc(v2);<br><br>	v0 = ndc_to_raster(v0, width, height);<br>	v1 = ndc_to_raster(v1, width, height);<br>	v2 = ndc_to_raster(v2, width, height);<br><br><br>	bool is_p1_inside = is_inside(v0, v1, v2, p1);<br><br>	if (is_p1_inside)<br>	{<br>		std::cout &lt;&lt; "p1 overlaps the triangle\n";<br>	}<br>	else<br>	{<br>		std::cout &lt;&lt; "p1 doesn't overlaps the triangle\n";<br>	}<br><br>	bool is_p2_inside = is_inside(v0, v1, v2, p2);<br><br>	if (is_p2_inside)<br>	{<br>		std::cout &lt;&lt; "p2 overlaps the triangle\n";<br>	}<br>	else<br>	{<br>		std::cout &lt;&lt; "p2 doesn't overlaps the triangle\n";<br>	}<br>	return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796491775/0a09b22c5d9a779a2c6c71e22b6a1cc1/image.png" />
         <pubDate>2022-10-17 04:33:17 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342528904</guid>
      </item>
      <item>
         <title>5646173 이수현</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342539031</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/vec2.hpp&gt;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	float myWidth = (c[0] - a[0]) * (b[1] - a[1]) - (c[1] - a[1]) * (b[0] - a[0]);<br>	//std::cout &lt;&lt; myWidth &lt;&lt; std::endl;<br>	return myWidth;<br>}<br><br>int main()<br>{<br>	int width = 100;<br>	int height = 100;<br>	glm::vec2 v0(-0.3f, -0.6f);<br>	glm::vec2 v1(0.3f, -0.6f);<br>	glm::vec2 v2(0.0f, 0.7f);<br><br>	v0.x = ((v0.x + 1) / 2) * 100;<br>	v0.y = ((1 - v0.y) / 2) * 100;<br>	if (v0.x == width)		v0.x = width - 1;<br>	if (v0.y == height)	v0.y = height - 1;<br><br>	v1.x = ((v1.x + 1) / 2) * 100;<br>	v1.y = ((1 - v1.y) / 2) * 100;<br>	if (v1.x == width)		v1.x = width - 1;<br>	if (v1.y == height)	v1.y = height - 1;<br><br>	v2.x = ((v2.x + 1) / 2) * 100;<br>	v2.y = ((1 - v2.y) / 2) * 100;<br>	if (v2.x == width)		v2.x = width - 1;<br>	if (v2.y == height)	v2.y = height - 1;<br><br>	glm::vec2 p1(50, 50);<br>	glm::vec2 p2(90, 50);<br><br>	<br>	bool insidep1 = (edgeFunction(v0, v1, p1) &gt; 0) &amp;&amp; (edgeFunction(v1, v2, p1) &gt; 0) &amp;&amp; (edgeFunction(v2, v0, p1) &gt; 0);<br>	bool insidep2 = (edgeFunction(v0, v1, p2) &gt; 0) &amp;&amp; (edgeFunction(v1, v2, p2) &gt; 0) &amp;&amp; (edgeFunction(v2, v0, p2) &gt; 0);<br>	<br>	//std::cout &lt;&lt; v0.x &lt;&lt; ", " &lt;&lt; v0.y &lt;&lt; std::endl;<br>	//std::cout &lt;&lt; v1.x &lt;&lt; ", " &lt;&lt; v1.y &lt;&lt; std::endl;<br>	//std::cout &lt;&lt; v2.x &lt;&lt; ", " &lt;&lt; v2.y &lt;&lt; std::endl;<br>	std::cout &lt;&lt; "(50,50) inside: " &lt;&lt; std::boolalpha &lt;&lt; insidep1 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; "(90,50) inside: " &lt;&lt; std::boolalpha &lt;&lt; insidep2 &lt;&lt; std::endl;<br><br>	return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1621868418/4b7907c12d5d0767954cd0505e0efe3b/image.png" />
         <pubDate>2022-10-17 04:43:35 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342539031</guid>
      </item>
      <item>
         <title>5470252 박주형</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342631120</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include &lt;glm/gtc/constants.hpp&gt;<br>#define GLM_FORCE_SWIZZLE<br>const double DEGREES_TO_RADIAS = glm::pi&lt;float&gt;() / 180.0;<br>const double RADIANS_TO_DEGREES = 180.0 / glm::pi&lt;float&gt;();<br>#define Wighth 100<br>#define Herght 100<br><br>using namespace glm;<br>using namespace std;<br><br>vec2 normallized_(vec2&amp; _vec)<br>{<br>&nbsp; &nbsp; _vec.x = (_vec.x + 1) / 2;<br>&nbsp; &nbsp; _vec.y = ( 1 -_vec.y ) / 2;<br>&nbsp; &nbsp; return _vec;<br>}<br><br>vec2 rester_space(vec2&amp; _vec)<br>{<br>&nbsp; &nbsp; _vec.x = _vec.x * Wighth;<br>&nbsp; &nbsp; _vec.y = _vec.y * Herght;<br>&nbsp; &nbsp; return _vec;<br>}<br><br>bool edgeFunction(vec2 a, vec2 b, vec2 c)<br>{<br>&nbsp; &nbsp; return ((c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x) &gt;= 0);<br>}<br><br><br>int main()<br>{<br>&nbsp; &nbsp; vec2 p1 = { 50,50 };<br>&nbsp; &nbsp; vec2 p2 = { 90,50 };<br><br>&nbsp; &nbsp; vec2 v0 = { -0.3f, -0.6f };<br>&nbsp; &nbsp; vec2 v1 = { 0, 0.7f };<br>&nbsp; &nbsp; vec2 v2 = { 0.3f, -0.6f };<br><br>&nbsp; &nbsp; v0 = normallized_(v0);<br>&nbsp; &nbsp; v1 = normallized_(v1);<br>&nbsp; &nbsp; v2 = normallized_(v2);<br>&nbsp; &nbsp; &nbsp; &nbsp;<br>&nbsp; &nbsp; v0 = rester_space(v0);<br>&nbsp; &nbsp; v1 = rester_space(v1);<br>&nbsp; &nbsp; v2 = rester_space(v2);<br><br>&nbsp; &nbsp; float ev_0 = edgeFunction(v2, v1, p1);<br>&nbsp; &nbsp; float ev_1 = edgeFunction(v0, v2, p1);<br>&nbsp; &nbsp; float ev_2 = edgeFunction(v1, v0, p1);<br><br>&nbsp; &nbsp; float ev_11 = edgeFunction(v2, v1, p2);<br>&nbsp; &nbsp; float ev_12 = edgeFunction(v0, v2, p2);<br>&nbsp; &nbsp; float ev_13 = edgeFunction(v1, v0, p2);<br><br>&nbsp; &nbsp; vec2 edge0 = v1 - v2;<br>&nbsp; &nbsp; vec2 edge1 = v2 - v1;<br>&nbsp; &nbsp; vec2 edge2 = v0 - v1;<br><br>&nbsp; &nbsp; bool isoverlaps1 = true;<br>&nbsp; &nbsp; bool isoverlaps2 = true;<br><br>&nbsp; &nbsp; cout &lt;&lt; " ev_0 : " &lt;&lt; ev_0 &lt;&lt; " \n";<br>&nbsp; &nbsp; cout &lt;&lt; " ev_1 : " &lt;&lt; ev_1 &lt;&lt; " \n";<br>&nbsp; &nbsp; cout &lt;&lt; " ev_2 : " &lt;&lt; ev_2 &lt;&lt; " \n";<br><br><br>&nbsp; &nbsp; // 포인트가 edge 상에 있는지, 오른쪽 왼쪽인지 테스트,&nbsp;<br><br>&nbsp; &nbsp; isoverlaps1 &amp;= (ev_0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (ev_0 &gt; 0));<br>&nbsp; &nbsp; isoverlaps1 &amp;= (ev_1 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (ev_1 &gt; 0));<br>&nbsp; &nbsp; isoverlaps1 &amp;= (ev_1 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (ev_2 &gt; 0));<br><br>&nbsp; &nbsp; isoverlaps2 &amp;= (ev_11 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (ev_11 &gt; 0));<br>&nbsp; &nbsp; isoverlaps2 &amp;= (ev_12 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (ev_12 &gt; 0));<br>&nbsp; &nbsp; isoverlaps2 &amp;= (ev_12 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (ev_13 &gt; 0));<br><br>&nbsp; &nbsp; cout &lt;&lt; " P1 : " &lt;&lt; isoverlaps1 &lt;&lt; " \n";<br><br>&nbsp; &nbsp; cout &lt;&lt; " P2 : " &lt;&lt; isoverlaps2 &lt;&lt; " \n";<br><br>&nbsp; &nbsp; return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1806587187/97eac67874aa0160f156ceb0b31fea2a/___.PNG" />
         <pubDate>2022-10-17 06:13:23 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342631120</guid>
      </item>
      <item>
         <title>5727889 김한빈</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342639570</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/vec2.hpp&gt;<br><br>using namespace std;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	return ((c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x) &gt;= 0);<br>}<br><br>int main()<br>{<br>&nbsp; &nbsp; float width = 100.0f;<br>&nbsp; &nbsp; float height = 100.0f;<br><br>&nbsp; &nbsp; glm::vec2 v0(-0.3f, -0.6f);<br>&nbsp; &nbsp; glm::vec2 v1(0.0f, 0.7f);<br>&nbsp; &nbsp; glm::vec2 v2(0.3f, -0.6f);<br><br>&nbsp; &nbsp; glm::vec2 p1(50, 50);<br>&nbsp; &nbsp; glm::vec2 p2(90, 50);<br><br>&nbsp; &nbsp; glm::vec2 v_r0;<br>&nbsp; &nbsp; glm::vec2 v_r1;<br>&nbsp; &nbsp; glm::vec2 v_r2;<br><br>&nbsp; &nbsp; v_r0.x = (int)(((v0.x + 1) / 2) * width);<br>&nbsp; &nbsp; v_r0.y = (int)(((1 - v0.y) / 2) * height);<br><br>&nbsp; &nbsp; v_r1.x = (int)(((v1.x + 1) / 2) * width);<br>&nbsp; &nbsp; v_r1.y = (int)(((1 - v1.y) / 2) * height);<br><br>&nbsp; &nbsp; v_r2.x = (int)(((v2.x + 1) / 2) * width);<br>&nbsp; &nbsp; v_r2.y = (int)(((1 - v2.y) / 2) * height);<br><br>&nbsp; &nbsp; if (v_r0.x == width)&nbsp; v_r0.x = width - 1;<br>&nbsp; &nbsp; if (v_r0.y == height) v_r0.y = height - 1;<br><br>&nbsp; &nbsp; if (v_r1.x == width)&nbsp; v_r1.x = width - 1;<br>&nbsp; &nbsp; if (v_r1.y == height) v_r1.y = height - 1;<br><br>&nbsp; &nbsp; if (v_r2.x == width)&nbsp; v_r2.x = width - 1;<br>&nbsp; &nbsp; if (v_r2.y == height) v_r2.y = height - 1;<br><br>&nbsp; &nbsp; float w0_1 = edgeFunction(v_r1, v_r0, p1);<br>&nbsp; &nbsp; float w1_1 = edgeFunction(v_r2, v_r1, p1);<br>&nbsp; &nbsp; float w2_1 = edgeFunction(v_r0, v_r2, p1);<br>&nbsp; &nbsp; float w0_2 = edgeFunction(v_r1, v_r0, p2);<br>&nbsp; &nbsp; float w1_2 = edgeFunction(v_r2, v_r1, p2);<br>&nbsp; &nbsp; float w2_2 = edgeFunction(v_r0, v_r2, p2);<br><br>&nbsp; &nbsp; if (w0_1 == true &amp;&amp; w1_1 == true &amp;&amp; w2_1 == true)<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(50,50) : inside" &lt;&lt; std::endl;<br>&nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(50,50) : outside" &lt;&lt; std::endl;<br><br>&nbsp; &nbsp; if (w0_2 == true &amp;&amp; w1_2 == true &amp;&amp; w2_2 == true)<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(90,50) : inside" &lt;&lt; std::endl;<br>&nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(90,50) : outside" &lt;&lt; std::endl;<br><br>&nbsp; &nbsp; return 0;<br>};</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796451542/b2ddf02d292f0cd0c4cff5826a9319eb/image.png" />
         <pubDate>2022-10-17 06:20:49 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342639570</guid>
      </item>
      <item>
         <title>5602313 박은빈</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342651837</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br><br>glm::vec2 ScreenToNDC(glm::vec2 v);<br>glm::vec2 NDCToRaster(glm::vec2 v, int width, int height);<br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c);<br>using namespace std;<br>int main()<br>{<br>	int width = 100;<br>	int height = 100;<br><br>	glm::vec2 v0(-0.3, -0.6);<br>	glm::vec2 v1(0.3, -0.6);<br>	glm::vec2 v2(0, 0.7);<br>	glm::vec2 p1(50, 50);<br>	glm::vec2 p2(90, 50);<br><br>	//NDC------------------------------------------------------------<br>	v0 = ScreenToNDC(v0);<br>	v1 = ScreenToNDC(v1);<br>	v2 = ScreenToNDC(v2);<br>	//raster-----------------------------------------------------------<br>	v0 = NDCToRaster(v0, width, height);<br>	v1 = NDCToRaster(v1, width, height);<br>	v2 = NDCToRaster(v2, width, height);<br><br>	cout &lt;&lt; glm::to_string(v0) &lt;&lt; endl &lt;&lt; glm::to_string(v1) &lt;&lt; endl &lt;&lt; glm::to_string(v2) &lt;&lt; endl;<br>	//-----------------------------------------------------------------<br><br>	float w0 = edgeFunction(v2,v1, p1);<br>	float w1 = edgeFunction(v1, v0, p1);<br>	float w2 = edgeFunction(v0, v2, p1);<br><br>	float _w0 = edgeFunction(v2, v1, p2);<br>	float _w1 = edgeFunction(v1, v0, p2);<br>	float _w2 = edgeFunction(v0, v2, p2);<br><br>	bool isP1 = true;<br>	bool isP2 = true;<br><br>	if (w0 &gt; 0 &amp;&amp; w1 &gt; 0 &amp;&amp; w2 &gt; 0)<br>		isP1 = true;<br>	else<br>		isP1 = false;<br><br>	if (_w0 &gt; 0 &amp;&amp; _w1 &gt; 0 &amp;&amp; _w2 &gt; 0)<br>		isP2 = true;<br>	else<br>		isP2 = false;<br><br>	if (isP1)<br>		std::cout &lt;&lt; "p1 is inside" &lt;&lt; std::endl;<br>	else if (!isP1)<br>		std::cout &lt;&lt; "p1 is outside" &lt;&lt; std::endl;<br><br>	if (isP2)<br>		std::cout &lt;&lt; "p2 is inside" &lt;&lt; std::endl;<br>	else if (!isP2)<br>		std::cout &lt;&lt; "p2 is outside" &lt;&lt; std::endl;<br><br><br>	return 0;<br>}<br><br>glm::vec2 ScreenToNDC(glm::vec2 v)<br>{<br>	glm::vec2 nor;<br>	nor.x = (v.x + 1) * 0.5f;<br>	nor.y = (1- v.y) * 0.5f;<br><br>	return nor;<br>}<br><br>glm::vec2 NDCToRaster(glm::vec2 v, int width, int height)<br>{<br>	glm::vec2 raster;<br><br>	raster.x = (int)(v.x * width);<br>	raster.y = (int)(v.y * height);<br><br>	if (raster.x == width)<br>		raster.x = width - 1;<br>	if (raster.y == height)<br>		raster.y = height - 1;<br><br>	return raster;<br>}<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	return(c[0] - a[0]) * (a[1] - b[1]) - (a[1] - c[1]) * (b[0] - a[0]);<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796477319/31d0781b6ed6cce4c2e4dfd7805e41e0/11.png" />
         <pubDate>2022-10-17 06:31:51 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342651837</guid>
      </item>
      <item>
         <title>5532640 박언</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342657087</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/vec2.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br><br>glm::vec2 normal(glm::vec2 vTemp);<br>glm::vec2 raster(glm::vec2 vTemp, int width, int height);<br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c);<br>bool isInside(glm::vec2 v0, glm::vec2 v1, glm::vec2 v2, glm::vec2 p);<br><br>using namespace std;<br>int main()<br>{<br>	glm::vec2 v0(-0.3, -0.6);<br>	glm::vec2 v1(0, 0.7);<br>	glm::vec2 v2(0.3, -0.6);<br><br>	v0 = normal(v0);<br>	v1 = normal(v1);<br>	v2 = normal(v2);<br><br>	v0 = raster(v0, 100, 100);<br>	v1 = raster(v1, 100, 100);<br>	v2 = raster(v2, 100, 100);<br><br>	cout &lt;&lt; glm::to_string(v0) &lt;&lt; endl &lt;&lt; glm::to_string(v1) &lt;&lt; endl &lt;&lt; glm::to_string(v2) &lt;&lt; endl;<br><br>	glm::vec2 p1(50, 50);<br>	glm::vec2 p2(90, 50);<br><br>	cout &lt;&lt; "p1 is ";<br>	isInside(v0, v1, v2, p1) ? cout &lt;&lt; "Inside" &lt;&lt; endl : cout &lt;&lt; "outside" &lt;&lt; endl;<br><br>	cout &lt;&lt; "p2 is ";<br>	isInside(v0, v1, v2, p2) ? cout &lt;&lt; "Inside" &lt;&lt; endl : cout &lt;&lt; "outside" &lt;&lt; endl;<br><br>	return 0;<br>}<br><br>bool isInside(glm::vec2 v0, glm::vec2 v1, glm::vec2 v2, glm::vec2 p)<br>{<br>	float w0 = edgeFunction(v1, v0, p);<br>	float w1 = edgeFunction(v2, v1, p);<br>	float w2 = edgeFunction(v0, v2, p);<br><br>	glm::vec2 edge0 = v0 - v1;<br>	glm::vec2 edge1 = v1 - v2;<br>	glm::vec2 edge2 = v2 - v0;<br><br>	bool overlaps = true;<br><br>	overlaps &amp;= (w0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (w0 &gt; 0));<br>	overlaps &amp;= (w1 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (w1 &gt; 0));<br>	overlaps &amp;= (w2 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (w2 &gt; 0));<br><br>	return overlaps;<br>}<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	return (c[0] - a[0]) * (b[1] - a[1]) - (c[1] - a[1]) * (b[0] - a[0]);<br>}<br><br>glm::vec2 normal(glm::vec2 vTemp)<br>{<br>	glm::vec2 nor;<br>	nor.x = (vTemp.x + 1) / 2;<br>	nor.y = (1 - vTemp.y) / 2;<br><br>	return nor;<br>}<br><br>glm::vec2 raster(glm::vec2 vTemp, int width, int height)<br>{<br>	glm::vec2 ras;<br>	ras.x = (int)(vTemp.x * width);<br>	ras.y = (int)(vTemp.y * height);<br><br>	return ras;<br><br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1851767471/466a9fed372fa6f851c7e7d28375ed20/image.png" />
         <pubDate>2022-10-17 06:36:12 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342657087</guid>
      </item>
      <item>
         <title>5529729 오승훈</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342665756</link>
         <description><![CDATA[<div>#define GLM_FORCE_SWIZZLE<br><br>#include &lt;stdio.h&gt;<br>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br>#include &lt;glm/gtc/constants.hpp&gt;<br>#include &lt;glm/mat4x4.hpp&gt;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	return (c[0] - a[0]) * (a[1] - b[1]) - (a[1] - c[1]) * (b[0] - a[0]);<br>}<br>int main()<br>{<br>	int width = 100, height = 100;<br><br>	glm::vec2 v0 = { -0.3,-0.6 };<br>	glm::vec2 v1 = { 0,0.7 };<br>	glm::vec2 v2 = { 0.3,-0.6};<br>	glm::vec2 p1 = { 50, 50 };<br>	glm::vec2 p2 = { 90, 50 };<br><br>	glm::vec2 ndcv0 = {(v0.x + 1) / 2 , (1-v0.y)/2};<br>	glm::vec2 ndcv1 = { (v1.x + 1) / 2 , (1 - v1.y) / 2 };<br>	glm::vec2 ndcv2 = { (v2.x + 1) / 2 , (1 - v2.y) / 2 };<br><br>	glm::vec2 rasterv0 = { int(ndcv0.x * width), int(ndcv0.y * height) };<br>	glm::vec2 rasterv1 = { int(ndcv1.x * width), int(ndcv1.y * height) };<br>	glm::vec2 rasterv2 = { int(ndcv2.x * width), int(ndcv2.y * height) };<br><br>	if (rasterv0.x == width) rasterv0.x = width - 1;<br>	if (rasterv0.y == height)rasterv0.y = height - 1;<br>	if (rasterv1.x == width) rasterv1.x = width - 1;<br>	if (rasterv1.y == height)rasterv1.y = height - 1;<br>	if (rasterv2.x == width) rasterv2.x = width - 1;<br>	if (rasterv2.y == height)rasterv2.y = height - 1;<br><br>	float w0 = edgeFunction(rasterv0, rasterv1, p1);<br>	float w1 = edgeFunction(rasterv1, rasterv2, p1);<br>	float w2 = edgeFunction(rasterv2, rasterv0, p1);<br><br>	float w3 = edgeFunction(rasterv0, rasterv1, p2);<br>	float w4 = edgeFunction(rasterv1, rasterv2, p2);<br>	float w5 = edgeFunction(rasterv2, rasterv0, p2);<br><br>	bool inside = true;&nbsp;<br>	if (w0 &gt; 0 &amp;&amp; w1 &gt; 0 &amp;&amp; w2 &gt; 0)<br>		inside = true;<br>	else<br>		inside = false;<br><br>	printf("p1\n");<br><br>	if (inside == true) {<br>		printf("inside = true\n");<br>	}<br>	else if (inside == false) {<br>		printf("inside = false\n");<br>	}<br><br>	bool inside2 = true;<br>	if (w3 &gt; 0 &amp;&amp; w4 &gt; 0 &amp;&amp; w5 &gt; 0)<br>		inside2 = true;<br>	else<br>		inside2 = false;<br><br>	printf("p2\n");<br><br>	if (inside2 == true) {<br>		printf("inside = true\n");<br>	}<br>	else if (inside2 == false) {<br>		printf("inside = false\n");<br>	}<br>}<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796489092/0c643bf0d2f5fb0b047714eb0c967166/2022_10_17_15_42_41.png" />
         <pubDate>2022-10-17 06:43:12 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342665756</guid>
      </item>
      <item>
         <title>5556917 웅악가</title>
         <author>1037378957</author>
         <link>https://padlet.com/mksung89/edge/wish/2342747339</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include&nbsp; &lt;glm/gtx/string_cast.hpp&gt;&nbsp;<br><br>int main()<br>{<br>&nbsp; &nbsp; int width = 100;<br>&nbsp; &nbsp; int height = 100;<br>&nbsp; &nbsp; glm::vec2 v0(-0.3f, -0.6f);<br>&nbsp; &nbsp; glm::vec2 v1(0.3f, -0.6f);<br>&nbsp; &nbsp; glm::vec2 v2(0.0f, 0.7f);<br>&nbsp; &nbsp; glm::vec2 p1(50, 50);<br>&nbsp; &nbsp; glm::vec2 p2(90, 50);<br><br>&nbsp; &nbsp; glm::vec2 v0nor;<br>&nbsp; &nbsp; glm::vec2 v1nor;<br>&nbsp; &nbsp; glm::vec2 v2nor;<br><br>&nbsp; &nbsp; v0nor.x = (v0.x + 1) / 2;<br>&nbsp; &nbsp; v0nor.y = (1 - v0.y) / 2;<br><br>&nbsp; &nbsp; v1nor.x = (v1.x + 1) / 2;<br>&nbsp; &nbsp; v1nor.y = (1 - v1.y) / 2;<br><br>&nbsp; &nbsp; v2nor.x = (v2.x + 1) / 2;<br>&nbsp; &nbsp; v2nor.y = (1 - v2.y) / 2;<br><br>&nbsp; &nbsp; glm::vec2 v0ras;<br>&nbsp; &nbsp; glm::vec2 v1ras;<br>&nbsp; &nbsp; glm::vec2 v2ras;<br><br>&nbsp; &nbsp; v0ras.x = (int)(v0nor.x * width);<br>&nbsp; &nbsp; v0ras.y = (int)(v0nor.y * height);<br><br>&nbsp; &nbsp; v1ras.x = (int)(v1nor.x * width);<br>&nbsp; &nbsp; v1ras.y = (int)(v1nor.y * height);<br><br>&nbsp; &nbsp; v2ras.x = (int)(v2nor.x * width);<br>&nbsp; &nbsp; v2ras.y = (int)(v2nor.y * height);<br><br>&nbsp; &nbsp; if (v0ras.x == width)&nbsp; v0ras.x = width&nbsp; - 1;<br>&nbsp; &nbsp; if (v0ras.y == height)v0ras.y = height - 1;<br><br>&nbsp; &nbsp; if (v1ras.x == width)&nbsp; v1ras.x = width - 1;<br>&nbsp; &nbsp; if (v1ras.y == height) v1ras.y = height - 1;<br><br>&nbsp; &nbsp; if (v2ras.x == width)&nbsp; v2ras.x = width - 1;<br>&nbsp; &nbsp; if (v2ras.y == height) v2ras.y = height - 1;<br><br>&nbsp; &nbsp; bool w0_1 = edgeFunction(v1ras, v2ras, p1);<br>&nbsp; &nbsp; bool w1_1 = edgeFunction(v2ras, v0ras, p1);<br>&nbsp; &nbsp; bool w2_1 = edgeFunction(v0ras, v1ras, p1);<br>&nbsp; &nbsp; bool w0_2 = edgeFunction(v1ras, v2ras, p2);<br>&nbsp; &nbsp; bool w1_2 = edgeFunction(v2ras, v0ras, p2);<br>&nbsp; &nbsp; bool w2_2 = edgeFunction(v0ras, v1ras, p2);<br><br>&nbsp; &nbsp; bool inp1,inp2;<br><br>&nbsp; &nbsp; if (w0_1 == true &amp;&amp; w1_1 == true &amp;&amp; w2_1 == true)&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(50,50) : inside" &lt;&lt; std::endl;<br>&nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(50,50) : outside" &lt;&lt; std::endl;<br><br>&nbsp; &nbsp; if (w0_2 == true &amp;&amp; w1_2 == true &amp;&amp; w2_2 == true)&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(90,50) : inside" &lt;&lt; std::endl;<br>&nbsp; &nbsp; else&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(90,50) : outside" &lt;&lt; std::endl;<br><br>return 0;<br>}<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1793771932/6562c402d16357e451cd60d2f3244767/22222.png" />
         <pubDate>2022-10-17 07:46:22 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342747339</guid>
      </item>
      <item>
         <title>5470343 이동찬</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2342757155</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp&gt;<br>#include &lt;glm/gtc/constants.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br><br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	return (c[0] - a[0]) * (a[1] - b[1]) - (a[1] - c[1]) * (b[0] - a[0]);<br>}<br><br><br>int main()<br>{	<br>	int width = 100, height = 100;<br><br>	glm::vec2 v0 = { -0.3f, -0.6f };<br>	glm::vec2 v1 = { 0.0f, 0.7f };<br>	glm::vec2 v2 = {0.3f, -0.6f};<br><br>	glm::vec2 p1 = { 50, 50 };<br>	glm::vec2 p2 = { 90, 50 };<br>	<br>	v0.x = ((v0.x + 1) / 2) * width;<br>	v0.y = ((1 - v0.y) / 2) * height;<br>	v1.x = ((v1.x + 1) / 2) * width;<br>	v1.y = ((1 - v1.y) / 2) * height;<br>	v2.x = ((v2.x + 1) / 2) * width;<br>	v2.y = ((1 - v2.y) / 2) * height;<br><br>	float w0 = edgeFunction(v1, v2, p1);<br>	float w1 = edgeFunction(v2, v0, p1);<br>	float w2 = edgeFunction(v0, v1, p1);<br><br>	float w0_2 = edgeFunction(v1, v2, p2);<br>	float w1_2 = edgeFunction(v2, v0, p2);<br>	float w2_2 = edgeFunction(v0, v1, p2);<br><br>	glm::vec2 edge0 = v2 - v1;<br>	glm::vec2 edge1 = v0 - v2;<br>	glm::vec2 edge2 = v1 - v0;<br><br>	bool overlaps1 = true;<br>	bool overlaps2 = true;<br><br>	// 포인트가 edge 상에 있는지, 오른쪽 왼쪽인지 테스트,&nbsp;<br>	//<br>	overlaps1 &amp;= (w0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (w0 &gt; 0));<br>	overlaps1 &amp;= (w1 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (w1 &gt; 0));<br>	overlaps1 &amp;= (w1 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (w2 &gt; 0));<br><br>	overlaps2 &amp;= (w0_2 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (w0_2 &gt; 0));<br>	overlaps2 &amp;= (w1_2 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (w1_2 &gt; 0));<br>	overlaps2 &amp;= (w1_2 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (w2_2 &gt; 0));<br>	<br>	if (overlaps1) {<br>		std::cout &lt;&lt; "p1은 내부에 존재" &lt;&lt; std::endl;<br>	}<br>	else std::cout &lt;&lt; "p1은 외부에 존재" &lt;&lt; std::endl;<br><br>	if (overlaps2) {<br>		std::cout &lt;&lt; "p2은 내부에 존재" &lt;&lt; std::endl;<br>	}<br>	else std::cout &lt;&lt; "p2은 외부에 존재" &lt;&lt; std::endl;<br><br>	return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1621877514/da08e22e28c5311d7c470157f5416750/________1.png" />
         <pubDate>2022-10-17 07:53:53 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342757155</guid>
      </item>
      <item>
         <title>5585300 김영미</title>
         <author>a01057202116</author>
         <link>https://padlet.com/mksung89/edge/wish/2342835948</link>
         <description><![CDATA[<div><br>using namespace glm;<br>using namespace std;<br><br>int w = 100, h = 100;<br><br>vec2 Raster(vec2&amp; a)<br>{<br>	a.x = ((a.x + 1) / 2)*w;<br>	a.y = ((1-a.y) / 2)*h; //방향이 반대이기 때문엔 1-a.y 해야함<br><br>	if (a.x == w)a.x = w - 1;<br>	if (a.y == h)a.x = h - 1;<br><br>	return a;<br>}<br><br>bool EdgeFunction(const vec2&amp; a, const vec2&amp; b, const vec2&amp; c)<br>{<br>	return ((c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x) &lt;= 0);// y축이 음수이기 때문에 0과 같거나 0보다 적음&nbsp;<br>}<br><br>string Iftrue(bool a)//안,밖 표시<br>{<br>	if (a == 1)<br>	{<br>		return "true, inside";<br>	}<br>	else<br>	{<br>		return "false, outside";<br>	}<br>}<br><br><br>int main()&nbsp;<br>{<br>vec2 v0 = { -0.3,-0.6 };<br>vec2 v1 = { 0,0.7 };<br>vec2 v2 = { 0.3,-0.6 };<br><br>vec2 P1 = { 50,50 };<br>vec2 P2 = { 90,50 };<br><br>v0 = Raster(v0);<br>v1 = Raster(v1);<br>v2 = Raster(v2);<br><br>float w0 = EdgeFunction(v1, v2, P1);<br>float w1 = EdgeFunction(v2, v0, P1);<br>float w2 = EdgeFunction(v0, v1, P1);<br><br>float m0 = EdgeFunction(v1, v2, P2);<br>float m1 = EdgeFunction(v2, v0, P2);<br>float m2 = EdgeFunction(v0, v1, P2);<br><br>float&nbsp; area= EdgeFunction(v0, v1, v2);<br><br><br>vec2 edge0 = v2 - v1;<br>vec2 edge1 = v0 - v2;<br>vec2 edge2 = v1 - v0;<br><br>bool overlaps = true;<br><br>// 포인트가 edge 상에 있는지, 오른쪽 왼쪽인지 테스트//<br>overlaps &amp;= (w0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (w0 &gt; 0));<br>overlaps &amp;= (w1 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (w1 &gt; 0));<br>overlaps &amp;= (w1 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (w2 &gt; 0));<br><br>cout &lt;&lt; "P1:" &lt;&lt; Iftrue(overlaps) &lt;&lt; endl;<br><br>overlaps &amp;= (w0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (m0 &gt; 0));<br>overlaps &amp;= (w1 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (m1 &gt; 0));<br>overlaps &amp;= (w1 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (m2 &gt; 0));<br><br>cout &lt;&lt; "P2:" &lt;&lt; Iftrue(overlaps) &lt;&lt; endl;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796487955/780e23859aa14043cb53c1d9f5ac56c1/image.png" />
         <pubDate>2022-10-17 08:57:58 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2342835948</guid>
      </item>
      <item>
         <title>5470496 최차웅</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2343041120</link>
         <description><![CDATA[<div>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/string_cast.hpp &gt;<br>#include &lt;iostream&gt;<br><br>using namespace std;<br>using namespace glm;<br><br>#define WIDTH 100<br>#define HEIGHT 100<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>&nbsp; &nbsp; return (c[0] - a[0]) * (a[1] - b[1]) - (a[1] - c[1]) * (b[0] - a[0]);<br>}<br><br>int main()<br>{<br>&nbsp; &nbsp; //값<br>&nbsp; &nbsp; /*int width = 100;<br>&nbsp; &nbsp; int height = 100;*/<br><br>&nbsp; &nbsp; vec2 v0 = {-0.3f, -0.6f};<br>&nbsp; &nbsp; vec2 v1 = {0.0f, 0.7f};<br>&nbsp; &nbsp; vec2 v2 = {0.3f, -0.6f};<br><br>&nbsp; &nbsp; vec2 p1 = {50, 50};<br>&nbsp; &nbsp; vec2 p2 = {90, 50};<br><br>&nbsp; &nbsp; bool overlaps1 = true;<br>&nbsp; &nbsp; bool overlaps2 = true;<br><br>&nbsp; &nbsp; // screen space coordinates 에서 NDC(normalized device coordinates)로 변환<br>&nbsp; &nbsp; v0.x = ((v0.x + 1) / 2) * WIDTH;<br>&nbsp; &nbsp; v0.y = ((1 - v0.y) / 2) * HEIGHT;<br>&nbsp; &nbsp; v1.x = ((v1.x + 1) / 2) * WIDTH;<br>&nbsp; &nbsp; v1.y = ((1 - v1.y) / 2) * HEIGHT;<br>&nbsp; &nbsp; v2.x = ((v2.x + 1) / 2) * WIDTH;<br>&nbsp; &nbsp; v2.y = ((1 - v2.y) / 2) * HEIGHT;<br><br>&nbsp; &nbsp; // edgeFunction<br>&nbsp; &nbsp; float p1_w0 = edgeFunction(v1, v2, p1);<br>&nbsp; &nbsp; float p1_w1 = edgeFunction(v2, v0, p1);<br>&nbsp; &nbsp; float p1_w2 = edgeFunction(v0, v1, p1);<br><br>&nbsp; &nbsp; float p2_w0 = edgeFunction(v1, v2, p2);<br>&nbsp; &nbsp; float p2_w1 = edgeFunction(v2, v0, p2);<br>&nbsp; &nbsp; float p2_w2 = edgeFunction(v0, v1, p2);<br><br>&nbsp; &nbsp; vec2 edge0 = v2 - v1;<br>&nbsp; &nbsp; vec2 edge1 = v0 - v2;<br>&nbsp; &nbsp; vec2 edge2 = v1 - v0;<br><br>&nbsp; &nbsp; // 포인트가 edge 상에 있는지, 오른쪽 왼쪽인지 테스트<br>&nbsp; &nbsp; overlaps1 &amp;= (p1_w0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (p1_w0 &gt; 0));<br>&nbsp; &nbsp; overlaps1 &amp;= (p1_w1 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (p1_w1 &gt; 0));<br>&nbsp; &nbsp; overlaps1 &amp;= (p1_w1 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (p1_w2 &gt; 0));<br><br>&nbsp; &nbsp; overlaps2 &amp;= (p2_w0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (p2_w0 &gt; 0));<br>&nbsp; &nbsp; overlaps2 &amp;= (p2_w1 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (p2_w1 &gt; 0));<br>&nbsp; &nbsp; overlaps2 &amp;= (p2_w1 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (p2_w2 &gt; 0));<br><br>&nbsp; &nbsp; // 출력<br>&nbsp; &nbsp; if (overlaps1) cout &lt;&lt; "p1 Inside" &lt;&lt; std::endl;<br>&nbsp; &nbsp; else cout &lt;&lt; "p1 Outside" &lt;&lt; std::endl;<br>&nbsp; &nbsp; if (overlaps2) cout &lt;&lt; "p2 Inside" &lt;&lt; std::endl;<br>&nbsp; &nbsp; else cout &lt;&lt; "p2 Outside" &lt;&lt; std::endl;<br><br>&nbsp; &nbsp; return 0;</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1811627799/fbad2ee6bfeb22ad728ed98da5cae9f5/__.PNG" />
         <pubDate>2022-10-17 11:54:25 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2343041120</guid>
      </item>
      <item>
         <title>5615182 유준지</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2343100698</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include&nbsp; &lt;glm/gtx/string_cast.hpp&gt;&nbsp;<br><br>int main()<br>{<br>&nbsp; &nbsp; int width = 100;<br>&nbsp; &nbsp; int height = 100;<br>&nbsp; &nbsp; glm::vec2 v0(-0.3f, -0.6f);<br>&nbsp; &nbsp; glm::vec2 v1(0.3f, -0.6f);<br>&nbsp; &nbsp; glm::vec2 v2(0.0f, 0.7f);<br>&nbsp; &nbsp; glm::vec2 p1(50, 50);<br>&nbsp; &nbsp; glm::vec2 p2(90, 50);<br><br>&nbsp; &nbsp; glm::vec2 v0nor;<br>&nbsp; &nbsp; glm::vec2 v1nor;<br>&nbsp; &nbsp; glm::vec2 v2nor;<br><br>&nbsp; &nbsp; v0nor.x = (v0.x + 1) / 2;<br>&nbsp; &nbsp; v0nor.y = (1 - v0.y) / 2;<br><br>&nbsp; &nbsp; v1nor.x = (v1.x + 1) / 2;<br>&nbsp; &nbsp; v1nor.y = (1 - v1.y) / 2;<br><br>&nbsp; &nbsp; v2nor.x = (v2.x + 1) / 2;<br>&nbsp; &nbsp; v2nor.y = (1 - v2.y) / 2;<br><br>&nbsp; &nbsp; glm::vec2 v0ras;<br>&nbsp; &nbsp; glm::vec2 v1ras;<br>&nbsp; &nbsp; glm::vec2 v2ras;<br><br>&nbsp; &nbsp; v0ras.x = (int)(v0nor.x * width);<br>&nbsp; &nbsp; v0ras.y = (int)(v0nor.y * height);<br><br>&nbsp; &nbsp; v1ras.x = (int)(v1nor.x * width);<br>&nbsp; &nbsp; v1ras.y = (int)(v1nor.y * height);<br><br>&nbsp; &nbsp; v2ras.x = (int)(v2nor.x * width);<br>&nbsp; &nbsp; v2ras.y = (int)(v2nor.y * height);<br><br>&nbsp; &nbsp; if (v0ras.x == width)&nbsp; v0ras.x = width&nbsp; - 1;<br>&nbsp; &nbsp; if (v0ras.y == height)v0ras.y = height - 1;<br><br>&nbsp; &nbsp; if (v1ras.x == width)&nbsp; v1ras.x = width - 1;<br>&nbsp; &nbsp; if (v1ras.y == height) v1ras.y = height - 1;<br><br>&nbsp; &nbsp; if (v2ras.x == width)&nbsp; v2ras.x = width - 1;<br>&nbsp; &nbsp; if (v2ras.y == height) v2ras.y = height - 1;<br><br>&nbsp; &nbsp; bool w0_1 = edgeFunction(v1ras, v2ras, p1);<br>&nbsp; &nbsp; bool w1_1 = edgeFunction(v2ras, v0ras, p1);<br>&nbsp; &nbsp; bool w2_1 = edgeFunction(v0ras, v1ras, p1);<br>&nbsp; &nbsp; bool w0_2 = edgeFunction(v1ras, v2ras, p2);<br>&nbsp; &nbsp; bool w1_2 = edgeFunction(v2ras, v0ras, p2);<br>&nbsp; &nbsp; bool w2_2 = edgeFunction(v0ras, v1ras, p2);<br><br>&nbsp; &nbsp; bool inp1,inp2;<br><br>&nbsp; &nbsp; if (w0_1 == true &amp;&amp; w1_1 == true &amp;&amp; w2_1 == true)&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(50,50) : inside" &lt;&lt; std::endl;<br>&nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(50,50) : outside" &lt;&lt; std::endl;<br><br>&nbsp; &nbsp; if (w0_2 == true &amp;&amp; w1_2 == true &amp;&amp; w2_2 == true)&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(90,50) : inside" &lt;&lt; std::endl;<br>&nbsp; &nbsp; else&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; std::cout &lt;&lt; "(90,50) : outside" &lt;&lt; std::endl;<br><br>return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1796495774/ab0c2f5360703caa7415e6e7b6c9edfd/image.webp" />
         <pubDate>2022-10-17 12:33:25 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2343100698</guid>
      </item>
      <item>
         <title>5727861 김유진</title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2343209598</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/vec2.hpp&gt;<br><br>float edgeFunction(const glm::vec2&amp; a, const glm::vec2&amp; b, const glm::vec2&amp; c)<br>{<br>	float resultWidth = (c[0] - a[0]) * (b[1] - a[1]) - (c[1] - a[1]) * (b[0] - a[0]);<br>	return resultWidth;<br>}<br><br>int main()<br>{<br>	int width = 100;<br>	int height = 100;<br>	glm::vec2 v0(-0.3f, -0.6f);<br>	glm::vec2 v1(0.3f, -0.6f);<br>	glm::vec2 v2(0.0f, 0.7f);<br><br>	v0.x = ((v0.x + 1))/2 * width;<br>	v0.y = ((1 - v0.y))/2 * height;<br>	if (v0.x == width)v0.x = width - 1;<br>	if (v0.y == height)v0.y = height - 1;<br><br>	v1.x = ((v1.x + 1))/2 * width;<br>	v1.y = ((1 - v1.y))/2 * height;<br>	if (v1.x == width)v1.x = width - 1;<br>	if (v1.y == height)v1.y = height - 1;<br><br>	v2.x = ((v2.x + 1))/2 * width;<br>	v2.y = ((1 - v2.y))/2 * height;<br>	if (v2.x == width)v2.x = width - 1;<br>	if (v2.y == height)v2.y = height - 1;<br><br>	<br>	glm::vec2 p1(50, 50);<br>	glm::vec2 p2(90, 50);<br><br>	bool insidep1 = (edgeFunction(v0, v1, p1) &gt; 0) &amp;&amp; (edgeFunction(v1, v2, p1) &gt; 0) &amp;&amp; (edgeFunction(v2, v0, p1) &gt; 0);<br>	bool insidep2 = (edgeFunction(v0, v1, p2) &gt; 0) &amp;&amp; (edgeFunction(v1, v2, p2) &gt; 0) &amp;&amp; (edgeFunction(v2, v0, p2) &gt; 0);<br><br><br>	std::cout &lt;&lt; "(50,50) inside: " &lt;&lt; std::boolalpha &lt;&lt; insidep1 &lt;&lt; std::endl;<br>	std::cout &lt;&lt; "(90,50) inside: " &lt;&lt; std::boolalpha &lt;&lt; insidep2 &lt;&lt; std::endl;<br><br>	return 0;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1817179688/5abcd816a63a669d6c04935c08655478/__.PNG" />
         <pubDate>2022-10-17 13:29:39 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2343209598</guid>
      </item>
      <item>
         <title></title>
         <author></author>
         <link>https://padlet.com/mksung89/edge/wish/2343233838</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;glm/glm.hpp&gt;<br>#include &lt;glm/gtx/transform.hpp&gt;<br>#include &lt;glm/gtx/matrix_transform_2d.hpp&gt;<br>#include&nbsp; &lt;glm/gtx/string_cast.hpp&gt;<br><br>using namespace glm;<br>using namespace std;<br><br>int w = 100, h = 100;<br><br>vec2 Raster(vec2&amp; a)<br>{<br>	a.x = ((a.x + 1) / 2) * w;<br>	a.y = ((1 - a.y) / 2) * h; //방향이 반대이기 때문엔 1-a.y 해야함<br><br>	if (a.x == w)a.x = w - 1;<br>	if (a.y == h)a.x = h - 1;<br><br>	return a;<br>}<br><br>bool EdgeFunction(const vec2&amp; a, const vec2&amp; b, const vec2&amp; c)<br>{<br>	return ((c.x - a.x) * (b.y - a.y) - (c.y - a.y) * (b.x - a.x) &lt;= 0);// y축이 음수이기 때문에 0과 같거나 0보다 적음&nbsp;<br>}<br><br>string Iftrue(bool a)//안,밖 표시<br>{<br>	if (a == 1)<br>	{<br>		return "true = inside";<br>	}<br>	else<br>	{<br>		return "false = outside";<br>	}<br>}<br><br><br>int main()<br>{<br>	vec2 v0 = { -0.3,-0.6 };<br>	vec2 v1 = { 0,0.7 };<br>	vec2 v2 = { 0.3,-0.6 };<br><br>	vec2 P1 = { 50,50 };<br>	vec2 P2 = { 90,50 };<br><br>	v0 = Raster(v0);<br>	v1 = Raster(v1);<br>	v2 = Raster(v2);<br><br>	float w0 = EdgeFunction(v1, v2, P1);<br>	float w1 = EdgeFunction(v2, v0, P1);<br>	float w2 = EdgeFunction(v0, v1, P1);<br><br>	float m0 = EdgeFunction(v1, v2, P2);<br>	float m1 = EdgeFunction(v2, v0, P2);<br>	float m2 = EdgeFunction(v0, v1, P2);<br><br>	float&nbsp; area = EdgeFunction(v0, v1, v2);<br><br><br>	vec2 edge0 = v2 - v1;<br>	vec2 edge1 = v0 - v2;<br>	vec2 edge2 = v1 - v0;<br><br>	bool overlaps = true;<br><br>	// 포인트가 edge 상에 있는지, 오른쪽 왼쪽인지 테스트//<br>	overlaps &amp;= (w0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (w0 &gt; 0));<br>	overlaps &amp;= (w1 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (w1 &gt; 0));<br>	overlaps &amp;= (w1 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (w2 &gt; 0));<br><br>	cout &lt;&lt; "P1: \n" &lt;&lt; Iftrue(overlaps) &lt;&lt; endl;<br><br>	overlaps &amp;= (w0 == 0 ? ((edge0.y == 0 &amp;&amp; edge0.x &gt; 0) || edge0.y &gt; 0) : (m0 &gt; 0));<br>	overlaps &amp;= (w1 == 0 ? ((edge1.y == 0 &amp;&amp; edge1.x &gt; 0) || edge1.y &gt; 0) : (m1 &gt; 0));<br>	overlaps &amp;= (w1 == 0 ? ((edge2.y == 0 &amp;&amp; edge2.x &gt; 0) || edge2.y &gt; 0) : (m2 &gt; 0));<br><br>	cout &lt;&lt; "P2: \n" &lt;&lt; Iftrue(overlaps) &lt;&lt; endl;<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1621893171/b5a6a061074417962ae15e2cde1c462f/image.png" />
         <pubDate>2022-10-17 13:40:58 UTC</pubDate>
         <guid>https://padlet.com/mksung89/edge/wish/2343233838</guid>
      </item>
   </channel>
</rss>
