如何在两点之间绘制一条线C ++? [英] How to sketch a line in between two points C++?

查看:115
本文介绍了如何在两点之间绘制一条线C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在c ++中绘制两个顶点之间的直线?我的意思是,例如,在2D平面中的(0,0)和(4,3)之间有字符。 (不使用c库函数)

is there any way to sketch a line between two vertices in c++? I mean, for example, between the (0,0) and (4,3) in 2D plane with characters. (without using c library functions)

推荐答案

例如,您可以使用Bresenham的线算法 [ ^ ]。
You might use, for instance, the "Bresenham's line algorithm"[^].


首先,这个问题是错误的。

快速回答:

是的总是可以在控制台模式下以图形模式完成。只是分辨率不能在2之间进行比较。



你说的标题和顶点中的点是2种不同的东西吗?

由于您使用的是C ++库,因此很容易使用C库函数。准确地说,这个请求是什么意思。因为输出字符到屏幕的功能在语言库中。
First of all, this is a wrong place for this question.
Quick Answer:
Yes it is always possible to do in console mode what is done in graphic mode. Simply the resolution do not compare between the 2.

You said "points" in title and "vertices" in question, is it 2 different things ?
No using C library functions is easy since you are using C++ library. What do you mean by this request, be precise. because the function that output chars to screen is in the language library.


这篇关于如何在两点之间绘制一条线C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆